From 60c2a0b70cb923635097e45dedd92e1a11d559a8 Mon Sep 17 00:00:00 2001 From: Bob Carmichael Date: Tue, 11 Jun 2024 07:29:39 -0400 Subject: [PATCH 1/4] reorganize LICENSE info --- NOTICE | 373 +----------------- public/fonts/LICENSE | 84 ++++ src/common/eulerian_trail/LICENSE | 21 + .../{ => eulerian_trail}/eulerianTrail.js | 2 +- src/common/noise.js | 3 +- src/features/effects/effectFactory.js | 2 +- src/features/effects/noise/LICENSE | 21 + src/features/effects/{ => noise}/Noise.js | 2 +- .../shapes/tessellation_twist/LICENSE | 19 + .../tessellation_twist/TessellationTwist.js | 2 +- 10 files changed, 158 insertions(+), 371 deletions(-) create mode 100644 public/fonts/LICENSE create mode 100644 src/common/eulerian_trail/LICENSE rename src/common/{ => eulerian_trail}/eulerianTrail.js (98%) create mode 100644 src/features/effects/noise/LICENSE rename src/features/effects/{ => noise}/Noise.js (98%) create mode 100644 src/features/shapes/tessellation_twist/LICENSE diff --git a/NOTICE b/NOTICE index e2643952..265fcaca 100644 --- a/NOTICE +++ b/NOTICE @@ -1,367 +1,8 @@ -General Information -========================================================= -Sandify incorporates code and font assets from various external sources, -each of which is covered by its own license and copyright notice. -These files are listed here with their corresponding authors, -permission notices, disclaimers, and copyright statements; these are also -referenced in various file headers as appropriate. - - -Apache License, Version 2.0, January 2004 -========================================================= -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, -and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by -the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all -other entities that control, are controlled by, or are under common -control with that entity. For the purposes of this definition, -"control" means (i) the power, direct or indirect, to cause the -direction or management of such entity, whether by contract or -otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity -exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation -source, and configuration files. - -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but -not limited to compiled object code, generated documentation, -and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or -Object form, made available under the License, as indicated by a -copyright notice that is included in or attached to the work -(an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, -the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including -the original version of the Work and any modifications or additions -to that Work or Derivative Works thereof, that is intentionally -submitted to Licensor for inclusion in the Work by the copyright owner -or by an individual or Legal Entity authorized to submit on behalf of -the copyright owner. For the purposes of this definition, "submitted" -means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, -and issue tracking systems that are managed by, or on behalf of, the -Licensor for the purpose of discussing and improving the Work, but -excluding communication that is conspicuously marked or otherwise -designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by Licensor and -subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the -Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except as stated in this section) patent license to make, have made, -use, offer to sell, sell, import, and otherwise transfer the Work, -where such license applies only to those patent claims licensable -by such Contributor that are necessarily infringed by their -Contribution(s) alone or by combination of their Contribution(s) -with the Work to which such Contribution(s) was submitted. If You -institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work -or a Contribution incorporated within the Work constitutes direct -or contributory patent infringement, then any patent licenses -granted to You under this License for that Work shall terminate -as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You -meet the following conditions: - -(a) You must give any other recipients of the Work or -Derivative Works a copy of this License; and - -(b) You must cause any modified files to carry prominent notices -stating that You changed the files; and - -(c) You must retain, in the Source form of any Derivative Works -that You distribute, all copyright, patent, trademark, and -attribution notices from the Source form of the Work, -excluding those notices that do not pertain to any part of -the Derivative Works; and - -(d) If the Work includes a "NOTICE" text file as part of its -distribution, then any Derivative Works that You distribute must -include a readable copy of the attribution notices contained -within such NOTICE file, excluding those notices that do not -pertain to any part of the Derivative Works, in at least one -of the following places: within a NOTICE text file distributed -as part of the Derivative Works; within the Source form or -documentation, if provided along with the Derivative Works; or, -within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents -of the NOTICE file are for informational purposes only and -do not modify the License. You may add Your own attribution -notices within Derivative Works that You distribute, alongside -or as an addendum to the NOTICE text from the Work, provided -that such additional attribution notices cannot be construed -as modifying the License. - -You may add Your own copyright statement to Your modifications and -may provide additional or different license terms and conditions -for use, reproduction, or distribution of Your modifications, or -for any such Derivative Works as a whole, provided Your use, -reproduction, and distribution of the Work otherwise complies with -the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work -by You to the Licensor shall be under the terms and conditions of -this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify -the terms of any separate license agreement you may have executed -with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or -agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied, including, without limitation, any warranties or conditions -of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, -unless required by applicable law (such as deliberate and grossly -negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, -work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses), even if such Contributor -has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing -the Work or Derivative Works thereof, You may choose to offer, -and charge a fee for, acceptance of support, warranty, indemnity, -or other liability obligations and/or rights consistent with this -License. However, in accepting such obligations, You may act only -on Your own behalf and on Your sole responsibility, not on behalf -of any other Contributor, and only if You agree to indemnify, -defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason -of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following -boilerplate notice, with the fields enclosed by brackets "[]" -replaced with your own identifying information. (Don't include -the brackets!) The text should be enclosed in the appropriate -comment syntax for the file format. We also recommend that a -file or class name and description of purpose be included on the -same "printed page" as the copyright notice for easier -identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +NOTICE - -SIL OPEN FONT LICENSE, Version 1.1 - 26 February 2007 -========================================================= -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting — in part or in whole — any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - - -Eulerian Trail, https://github.com/mauriciopoppe/eulerian-trail -========================================================= -The MIT License (MIT) - -Copyright (c) 2015 Mauricio Poppe - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -Noisejs, https://gitlab.ilmiont.net/ilmiont/noisejs/ -========================================================= -This project is no longer maintained by the contributor (deleted from GitHub), and was in turn -adapted from an older project, https://github.com/josephg/noisejs. - -MIT License - -Copyright (c) 2018 James Walker - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -Tesselation Twist, https://codepen.io/rafaelpascoalrodrigues/pen/KpBJve -========================================================= -Copyright (c) 2015 by Rafael Pascoal Rodrigues -(https://codepen.io/rafaelpascoalrodrigues/pen/KpBJve) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Sandify incorporates code and font assets from various external sources, +each of may be covered by its own license and copyright notice. Where applicable, +libraries and their licenses are included in the "node_modules" +directory as part of the standard npm installation process. Additional licensing +information can be found, when applicable, in subdirectory LICENSE files and in source +files. diff --git a/public/fonts/LICENSE b/public/fonts/LICENSE new file mode 100644 index 00000000..ded8b253 --- /dev/null +++ b/public/fonts/LICENSE @@ -0,0 +1,84 @@ +SIL OPEN FONT LICENSE, Version 1.1 - 26 February 2007 + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting — in part or in whole — any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/src/common/eulerian_trail/LICENSE b/src/common/eulerian_trail/LICENSE new file mode 100644 index 00000000..3672d267 --- /dev/null +++ b/src/common/eulerian_trail/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Mauricio Poppe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/common/eulerianTrail.js b/src/common/eulerian_trail/eulerianTrail.js similarity index 98% rename from src/common/eulerianTrail.js rename to src/common/eulerian_trail/eulerianTrail.js index 463a4626..a2c94206 100644 --- a/src/common/eulerianTrail.js +++ b/src/common/eulerian_trail/eulerianTrail.js @@ -1,5 +1,5 @@ // adapted from https://github.com/mauriciopoppe/eulerian-trail/blob/master/lib/eulerian-trail.js -// see NOTICE for license details +// see LICENSE for license details // commented out thrown exceptions to return non-optimal eulerian paths export const eulerianTrail = (options) => { var g = [] diff --git a/src/common/noise.js b/src/common/noise.js index 6c7f03be..e7910872 100644 --- a/src/common/noise.js +++ b/src/common/noise.js @@ -1,4 +1,5 @@ -// Adapted from https://gitlab.ilmiont.net/ilmiont/noisejs/. See NOTICE for licensing details. +// Adapted from https://gitlab.ilmiont.net/ilmiont/noisejs/. +// See LICENSE for licensing details. /** * Perlin fade function. diff --git a/src/features/effects/effectFactory.js b/src/features/effects/effectFactory.js index 7323c3a3..526fd373 100644 --- a/src/features/effects/effectFactory.js +++ b/src/features/effects/effectFactory.js @@ -2,7 +2,7 @@ import FineTuning from "./FineTuning" import Fisheye from "./Fisheye" import Loop from "./Loop" import Mask from "./Mask" -import Noise from "./Noise" +import Noise from "./noise/Noise" import Track from "./Track" import Transformer from "./Transformer" import Warp from "./Warp" diff --git a/src/features/effects/noise/LICENSE b/src/features/effects/noise/LICENSE new file mode 100644 index 00000000..a6250eb8 --- /dev/null +++ b/src/features/effects/noise/LICENSE @@ -0,0 +1,21 @@ +This project is no longer maintained by the contributor (deleted from GitHub), and was in turn +adapted from an older project, https://github.com/josephg/noisejs. + +MIT License + +Copyright (c) 2018 James Walker + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/features/effects/Noise.js b/src/features/effects/noise/Noise.js similarity index 98% rename from src/features/effects/Noise.js rename to src/features/effects/noise/Noise.js index 338cb555..35d3d945 100644 --- a/src/features/effects/Noise.js +++ b/src/features/effects/noise/Noise.js @@ -1,5 +1,5 @@ import Victor from "victor" -import Effect from "./Effect" +import Effect from "../Effect" import noise from "@/common/noise" import { subsample } from "@/common/geometry" diff --git a/src/features/shapes/tessellation_twist/LICENSE b/src/features/shapes/tessellation_twist/LICENSE new file mode 100644 index 00000000..0bc97173 --- /dev/null +++ b/src/features/shapes/tessellation_twist/LICENSE @@ -0,0 +1,19 @@ +Tesselation Twist, https://codepen.io/rafaelpascoalrodrigues/pen/KpBJve + +Copyright (c) 2015 by Rafael Pascoal Rodrigues +(https://codepen.io/rafaelpascoalrodrigues/pen/KpBJve) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/features/shapes/tessellation_twist/TessellationTwist.js b/src/features/shapes/tessellation_twist/TessellationTwist.js index 9e2ba356..01c602bf 100644 --- a/src/features/shapes/tessellation_twist/TessellationTwist.js +++ b/src/features/shapes/tessellation_twist/TessellationTwist.js @@ -1,6 +1,6 @@ import Victor from "victor" import Graph, { mix } from "@/common/Graph" -import { eulerianTrail } from "@/common/eulerianTrail" +import { eulerianTrail } from "@/common/eulerian_trail/eulerianTrail" import { difference } from "@/common/util" import { cloneVertices } from "@/common/geometry" import Shape from "../Shape" From 883bdef388d65639d504206448678dd644432d54 Mon Sep 17 00:00:00 2001 From: Bob Carmichael Date: Tue, 11 Jun 2024 07:30:44 -0400 Subject: [PATCH 2/4] some spacing; add link text --- src/features/layers/LayerEditor.js | 16 ++++++++-------- src/features/shapes/Circle.js | 2 ++ src/features/shapes/Epicycloid.js | 3 +++ src/features/shapes/FancyText.js | 2 ++ src/features/shapes/Heart.js | 6 +++++- src/features/shapes/NoiseWave.js | 7 +++++++ src/features/shapes/Polygon.js | 7 +++++++ src/features/shapes/Reuleaux.js | 11 ++++++++++- src/features/shapes/Rose.js | 2 ++ src/features/shapes/Star.js | 3 +++ src/features/shapes/Wiper.js | 19 +++++++++++++++---- .../shapes/circle_packer/CirclePacker.js | 9 ++++++++- .../fractal_spirograph/FractalSpirograph.js | 2 ++ src/features/shapes/input_text/InputText.js | 14 ++++++++++++-- src/features/shapes/lsystem/LSystem.js | 2 ++ .../shapes/space_filler/SpaceFiller.js | 4 ++-- 16 files changed, 90 insertions(+), 19 deletions(-) diff --git a/src/features/layers/LayerEditor.js b/src/features/layers/LayerEditor.js index 2f134875..6eed4a46 100644 --- a/src/features/layers/LayerEditor.js +++ b/src/features/layers/LayerEditor.js @@ -34,7 +34,7 @@ const LayerEditor = () => { const link = model.link const linkText = model.linkText || "here" const renderedLink = link ? ( -
+
See{" "} { href={link} > {linkText} - {" "} - for ideas. + for more information.
) : undefined @@ -122,10 +121,9 @@ const LayerEditor = () => { {renderedModelSelection} {renderedModelOptions} {renderOption({ optionKey: "connectionMethod" })} - {renderedLink}
-
- {model.canTransform(layer) && ( + {model.canTransform(layer) && ( +
Transform @@ -206,8 +204,10 @@ const LayerEditor = () => { )} - )} -
+
+ )} + {renderedLink} +
diff --git a/src/features/shapes/Circle.js b/src/features/shapes/Circle.js index 57932843..5d8dd7b3 100644 --- a/src/features/shapes/Circle.js +++ b/src/features/shapes/Circle.js @@ -36,6 +36,7 @@ export default class Circle extends Shape { if (state.shape.circleDirection === "counterclockwise") { for (let i = 128; i >= 0; i--) { let angle = ((Math.PI * 2.0) / 128.0) * i + points.push( new Victor( Math.cos(angle), @@ -46,6 +47,7 @@ export default class Circle extends Shape { } else { for (let i = 0; i <= 128; i++) { let angle = ((Math.PI * 2.0) / 128.0) * i + points.push( new Victor( Math.cos(angle), diff --git a/src/features/shapes/Epicycloid.js b/src/features/shapes/Epicycloid.js index f7fea905..3bf028ac 100644 --- a/src/features/shapes/Epicycloid.js +++ b/src/features/shapes/Epicycloid.js @@ -36,13 +36,16 @@ export default class Epicycloid extends Shape { let a = parseInt(state.shape.epicycloidA) let b = parseInt(state.shape.epicycloidB) let reduced = reduce(a, b) + a = reduced[0] b = reduced[1] + let rotations = Number.isInteger(a / b) ? 1 : b let scale = 1 / (a + 2 * b) for (let i = 0; i < 128 * rotations; i++) { let angle = ((Math.PI * 2.0) / 128.0) * i + points.push( new Victor( (a + b) * Math.cos(angle) - b * Math.cos(((a + b) / b) * angle), diff --git a/src/features/shapes/FancyText.js b/src/features/shapes/FancyText.js index b91f6f14..166788a3 100644 --- a/src/features/shapes/FancyText.js +++ b/src/features/shapes/FancyText.js @@ -294,6 +294,7 @@ export default class FancyText extends Shape { const segment = this.shortestPathAroundLoop(start, end, points) segment.push(new Victor(next.x, next.y)) + return { segment, end, nextStart } } @@ -355,6 +356,7 @@ export default class FancyText extends Shape { // determine, so we're hard-wiring the rules, e.g. ('i', 'j') const samplePoint = [points[i][0].x, points[i][0].y] let idx = childMap[i] + if (idx === undefined) { idx = polygons.findIndex((polygon) => { return pointInPolygon(samplePoint, polygon) diff --git a/src/features/shapes/Heart.js b/src/features/shapes/Heart.js index 8995c640..6d3c5c97 100644 --- a/src/features/shapes/Heart.js +++ b/src/features/shapes/Heart.js @@ -5,6 +5,8 @@ export default class Heart extends Shape { constructor() { super("heart") this.label = "Heart" + this.link = "http://mathworld.wolfram.com/HeartCurve.html" + this.linkText = "HeartCurve at Wolfram Mathworld" } getInitialState() { @@ -16,12 +18,14 @@ export default class Heart extends Shape { } } + // heart equation from: http://mathworld.wolfram.com/HeartCurve.html getVertices(state) { const points = [] + for (let i = 0; i < 128; i++) { let angle = ((Math.PI * 2.0) / 128.0) * i let scale = 0.9 - // heart equation from: http://mathworld.wolfram.com/HeartCurve.html + points.push( new Victor( scale * 1.0 * Math.pow(Math.sin(angle), 3), diff --git a/src/features/shapes/NoiseWave.js b/src/features/shapes/NoiseWave.js index 7371beb0..e72f7237 100644 --- a/src/features/shapes/NoiseWave.js +++ b/src/features/shapes/NoiseWave.js @@ -78,6 +78,7 @@ export default class NoiseWave extends Shape { noise.seed(shape.seed) const particles = [] + for (let i = 0; i < shape.numParticles; i++) { const p1 = { x: sizeX * rng() - sizeX / 2, @@ -103,6 +104,7 @@ export default class NoiseWave extends Shape { for (let iterations = 0; iterations <= 1000; iterations++) { // This has side effects on the particle const newVertex = this.getParticleVertex(particle, shape) + group.push(newVertex) // Stop if we entered and then exited the machine coordinates. @@ -112,6 +114,7 @@ export default class NoiseWave extends Shape { } wasInside = inside } + return group }) @@ -125,6 +128,7 @@ export default class NoiseWave extends Shape { const end = curve[0] const startPerimeter = machine.nearestPerimeterVertex(start) const endPerimeter = machine.nearestPerimeterVertex(end) + vertices = vertices.concat( [ startPerimeter, @@ -158,12 +162,15 @@ export default class NoiseWave extends Shape { getCurve(vertexGroups, idx) { const pEndVertices = vertexGroups[idx] const pStartVertices = vertexGroups[idx + 1] + return pStartVertices.reverse().concat(pEndVertices) } getParticleVertex(p, options) { let periodDenominator = 600 - options.noiseLevel + if (options.noiseLevel >= 600) periodDenominator = 1 + const period = 1 / periodDenominator const v = options.noiseType === "Simplex" diff --git a/src/features/shapes/Polygon.js b/src/features/shapes/Polygon.js index bb9400f5..5ba7ebb4 100644 --- a/src/features/shapes/Polygon.js +++ b/src/features/shapes/Polygon.js @@ -47,21 +47,27 @@ export default class Polygon extends Shape { getVertices(state) { // beta is the fraction to have rounded. const beta = state.shape.roundFraction + // alpha is the fration to have straight. const alpha = 1.0 - beta + let points = [] + for (let i = 0; i <= state.shape.polygonSides; i++) { const angle = ((Math.PI * 2.0) / state.shape.polygonSides) * (0.5 + i) + if (state.shape.roundCorners && beta !== 0.0) { // angles that make up the arc. const angleStart = ((Math.PI * 2.0) / state.shape.polygonSides) * i const angleEnd = ((Math.PI * 2.0) / state.shape.polygonSides) * (i + 1) const angleResolution = 0.1 + if (points.length > 0) { // Start with a line. We use a bunch of points for this, so they get stretch about evenly // as the curves do. const numberOfLinePoints = (angleEnd - angleStart) / angleResolution / beta + points = points.concat( this.getLineVertices( points[points.length - 1], @@ -101,6 +107,7 @@ export default class Polygon extends Shape { getLineVertices(startPoint, endPoint, numberOfPoints) { const resolution = 1.0 / numberOfPoints let points = [] + for (let d = resolution; d <= 1.0; d += resolution) { points.push( new Victor( diff --git a/src/features/shapes/Reuleaux.js b/src/features/shapes/Reuleaux.js index 9c70683b..35c71389 100644 --- a/src/features/shapes/Reuleaux.js +++ b/src/features/shapes/Reuleaux.js @@ -26,23 +26,31 @@ export default class Reuleaux extends Shape { getVertices(state) { let points = [] - // Construct an equalateral triangle + + // Construct an equilateral triangle let corners = [] + // Initial location at PI/2 let angle = Math.PI / 2.0 + // How much of the circle in one side? let coverageAngle = Math.PI / state.shape.reuleauxSides let halfCoverageAngle = 0.5 * coverageAngle + for (let c = 0; c < state.shape.reuleauxSides; c++) { let startAngle = angle + Math.PI - halfCoverageAngle + corners.push([new Victor(Math.cos(angle), Math.sin(angle)), startAngle]) angle += (2.0 * Math.PI) / state.shape.reuleauxSides } + let length = 0.5 / Math.cos(Math.PI / 2.0 / state.shape.reuleauxSides) const scale = 1.7 + for (let corn = 0; corn < corners.length; corn++) { for (let i = 0; i < 128; i++) { let angle = coverageAngle * (i / 128.0) + corners[corn][1] + points.push( new Victor( scale * (length * corners[corn][0].x + Math.cos(angle)), @@ -51,6 +59,7 @@ export default class Reuleaux extends Shape { ) } } + return points } diff --git a/src/features/shapes/Rose.js b/src/features/shapes/Rose.js index ff9c18dd..8bf76db2 100644 --- a/src/features/shapes/Rose.js +++ b/src/features/shapes/Rose.js @@ -45,8 +45,10 @@ export default class Rose extends Shape { for (let i = 0; i < thetaClose + 1; i++) { let theta = ((Math.PI * 2.0) / resolution) * i let r = 0.5 * a * Math.sin((n / d) * theta) + points.push(new Victor(r * Math.cos(theta), r * Math.sin(theta))) } + return points } diff --git a/src/features/shapes/Star.js b/src/features/shapes/Star.js index 03b76f54..1498c3d6 100644 --- a/src/features/shapes/Star.js +++ b/src/features/shapes/Star.js @@ -35,9 +35,11 @@ export default class Star extends Shape { getVertices(state) { let points = [] + for (let i = 0; i <= state.shape.points * 2; i++) { let angle = ((Math.PI * 2.0) / (2.0 * state.shape.points)) * i let star_scale = 1.0 + if (i % 2 === 0) { star_scale *= state.shape.starRatio } @@ -45,6 +47,7 @@ export default class Star extends Shape { new Victor(star_scale * Math.cos(angle), star_scale * Math.sin(angle)), ) } + return points } } diff --git a/src/features/shapes/Wiper.js b/src/features/shapes/Wiper.js index de50c707..fb302eef 100644 --- a/src/features/shapes/Wiper.js +++ b/src/features/shapes/Wiper.js @@ -34,6 +34,7 @@ const outOfBounds = (point, width, height) => { if (point.y > height / 2.0) { return true } + return false } @@ -41,11 +42,12 @@ const outOfBounds = (point, width, height) => { // This will keep the shape. i.e. It will follow the line segment, and return the point on that line // segment. function boundPoint(good, bad, size_x, size_y) { - var dx = good.x - bad.x - var dy = good.y - bad.y + let dx = good.x - bad.x + let dy = good.y - bad.y + + let fixed = new Victor(bad.x, bad.y) + let distance = 0 - var fixed = new Victor(bad.x, bad.y) - var distance = 0 if (bad.x < -size_x || bad.x > size_x) { if (bad.x < -size_x) { // we are leaving the left @@ -54,8 +56,10 @@ function boundPoint(good, bad, size_x, size_y) { // we are leaving the right fixed.x = size_x } + distance = (fixed.x - good.x) / dx fixed.y = good.y + distance * dy + // We fixed x, but y might have the same problem, so we'll rerun this, with different points. return boundPoint(good, fixed, size_x, size_y) } @@ -67,9 +71,11 @@ function boundPoint(good, bad, size_x, size_y) { // we are leaving the top fixed.y = size_y } + distance = (fixed.y - good.y) / dy fixed.x = good.x + distance * dx } + return fixed } @@ -126,6 +132,7 @@ function spiralVertices(state) { function linearVertices(state) { // Get the angle between 0,180 let angle = (180.0 - (state.shape.wiperAngleDeg % 360)) % 180.0 + if (angle < 0.0) { angle += 180.0 } @@ -136,6 +143,7 @@ function linearVertices(state) { let width = 1 let outputVertices = [] let machine = state.machine + if (machine.type === "rectangular") { height = machine.maxY - machine.minY width = machine.maxX - machine.minX @@ -169,6 +177,7 @@ function linearVertices(state) { orig_delta_w = orig_delta_w.clone().multiply(Victor(-1.0, -1.0)) orig_delta_h = orig_delta_h.clone().multiply(Victor(-1.0, -1.0)) } + let delta_w = orig_delta_w let delta_h = orig_delta_h let endLocation = startLocation.clone().multiply(Victor(-1.0, -1.0)) @@ -179,6 +188,7 @@ function linearVertices(state) { let nextHeightPoint = startLocation let emergency_break = 0 + while (emergency_break < 1000) { emergency_break += 1 @@ -270,6 +280,7 @@ function linearVertices(state) { delta_w = orig_delta_h } } + return outputVertices } diff --git a/src/features/shapes/circle_packer/CirclePacker.js b/src/features/shapes/circle_packer/CirclePacker.js index ae766b7b..b47f7122 100644 --- a/src/features/shapes/circle_packer/CirclePacker.js +++ b/src/features/shapes/circle_packer/CirclePacker.js @@ -124,9 +124,11 @@ export default class CirclePacker extends Shape { let attempts = this.settings.rectangular ? this.settings.attempts * RECTANGULAR_ATTEMPTS_MULTIPLIER : this.settings.attempts + if (attempts <= 0) { attempts = 1 } + const rounds = Math.floor(ROUNDS * (ROUNDS / attempts)) for (let round = 0; round < rounds; round++) { @@ -187,9 +189,10 @@ export default class CirclePacker extends Shape { angle = this.connectAlongPerimeter(prev, curr, angle) } } - intersection = this.boundaryIntersection(prev) + const angle2 = Math.atan2(intersection.y - prev.y, intersection.x - prev.x) + this.points.push(...arc(prev.r, angle, angle2, prev.x, prev.y)) } @@ -276,6 +279,7 @@ export default class CirclePacker extends Shape { const a3 = Math.atan2(li2.y - to.y, li2.x - to.x) this.points.push(...arc(from.r, startingAngle, a2, from.x, from.y)) + return a3 } @@ -304,6 +308,7 @@ export default class CirclePacker extends Shape { if (stack.length > 0) { const p1 = stack[0] const li1 = closest(c.lineIntersection(c, p1), c) + a1 = Math.atan2(li1.y - p1.y, li1.x - p1.x) if (stack.length > 1) { @@ -326,6 +331,7 @@ export default class CirclePacker extends Shape { // draw arc to perimeter const a2 = Math.atan2(intersection.y - c.y, intersection.x - c.x) + this.points.push(...arc(c.r, angle, a2, c.x, c.y)) // connect along perimeter @@ -333,6 +339,7 @@ export default class CirclePacker extends Shape { ...this.settings, type: this.settings.rectangular ? "rectangular" : "polar", }) + this.points.push(...machine.tracePerimeter(intersection, intersection2)) this.points.push(intersection2) diff --git a/src/features/shapes/fractal_spirograph/FractalSpirograph.js b/src/features/shapes/fractal_spirograph/FractalSpirograph.js index 02aaefe4..e810a8cf 100644 --- a/src/features/shapes/fractal_spirograph/FractalSpirograph.js +++ b/src/features/shapes/fractal_spirograph/FractalSpirograph.js @@ -85,7 +85,9 @@ export default class FractalSpirograph extends Shape { } const scale = 5 // to normalize starting size + points.forEach((point) => point.multiply({ x: scale, y: scale })) + return points } diff --git a/src/features/shapes/input_text/InputText.js b/src/features/shapes/input_text/InputText.js index 44da3812..03f70cae 100644 --- a/src/features/shapes/input_text/InputText.js +++ b/src/features/shapes/input_text/InputText.js @@ -24,11 +24,13 @@ const options = { function getMaxX(points) { // Measure the width of the line let maxX = 0 + points.forEach((point) => { if (point.x > maxX) { maxX = point.x } }) + return maxX } @@ -60,7 +62,8 @@ export default class InputText extends Shape { let textPoints = [] for (let chi = 0; chi < state.shape.inputText.length; chi++) { - var nextLetter = state.shape.inputText[chi] + let nextLetter = state.shape.inputText[chi] + if ( prevLetter === "b" || prevLetter === "v" || @@ -69,6 +72,7 @@ export default class InputText extends Shape { ) { // Save this letter before we possibly add in a '*' prevLetter = nextLetter + if ( nextLetter.search("[a-z]+") !== -1 && state.shape.inputFont === "Cursive" @@ -87,7 +91,8 @@ export default class InputText extends Shape { continue } - var shape = undefined + let shape = undefined + if (state.shape.inputFont === "Cursive") { shape = CursiveFont(nextLetter) } else if (state.shape.inputFont === "Sans Serif") { @@ -143,6 +148,7 @@ export default class InputText extends Shape { } else { // This variable controls "Top" vs. "Bottom" let direction = 1.0 + if (state.shape.rotateDir === "Bottom") { direction = -1.0 lines.reverse() @@ -180,6 +186,7 @@ export default class InputText extends Shape { lines.forEach((points) => { let maxX = getMaxX(points) + // This widthOffset is in X. let widthOffset = maxX / 2.0 @@ -196,6 +203,7 @@ export default class InputText extends Shape { // Get the Y value of the first point in the next (this) line. let r = rOffset + rPerY * 0.0 + if (points.length > 0) { r = rOffset + rPerY * points[0].y } @@ -221,7 +229,9 @@ export default class InputText extends Shape { } const scale = 2.5 // to normalize starting size + textPoints.forEach((point) => point.multiply({ x: scale, y: scale })) + return textPoints } diff --git a/src/features/shapes/lsystem/LSystem.js b/src/features/shapes/lsystem/LSystem.js index aa0e6f4b..4313c732 100644 --- a/src/features/shapes/lsystem/LSystem.js +++ b/src/features/shapes/lsystem/LSystem.js @@ -53,6 +53,7 @@ export default class LSystem extends Shape { // generate our vertices using a set of l-system rules let config = subtypes[shape.subtype] + config.iterations = iterations config.side = 5 @@ -62,6 +63,7 @@ export default class LSystem extends Shape { let curve = lsystemPath(lsystem(config), config) const scale = 18.0 // to normalize starting size + return resizeVertices(curve, scale, scale) } diff --git a/src/features/shapes/space_filler/SpaceFiller.js b/src/features/shapes/space_filler/SpaceFiller.js index de5044e4..3d3ea87c 100644 --- a/src/features/shapes/space_filler/SpaceFiller.js +++ b/src/features/shapes/space_filler/SpaceFiller.js @@ -66,8 +66,8 @@ export default class SpaceFiller extends Shape { getVertices(state) { const machine = getMachine(state.machine) const iterations = state.shape.iterations || 1 - let { sizeX, sizeY } = machine + if (state.machine.type === "rectangular") { sizeX = sizeX * 2 sizeY = sizeY * 2 @@ -75,8 +75,8 @@ export default class SpaceFiller extends Shape { // generate our vertices using a set of l-system rules let config = subtypes[state.shape.fillerSubtype] - config.iterations = iterations + config.iterations = iterations if (config.side === undefined) { config.side = 5 } From e3ac932e93cbbe78ff262d5bf90620139b23414c Mon Sep 17 00:00:00 2001 From: Bob Carmichael Date: Wed, 12 Jun 2024 20:57:29 -0400 Subject: [PATCH 3/4] add shape descriptions where applicable --- src/features/layers/LayerEditor.js | 32 +++++++++++-------- src/features/shapes/Epicycloid.js | 4 ++- src/features/shapes/Heart.js | 4 ++- src/features/shapes/Hypocycloid.js | 4 ++- src/features/shapes/NoiseWave.js | 4 +++ src/features/shapes/Reuleaux.js | 4 +++ src/features/shapes/Rose.js | 6 ++-- .../shapes/circle_packer/CirclePacker.js | 4 +++ .../fractal_spirograph/FractalSpirograph.js | 6 ++-- src/features/shapes/lsystem/LSystem.js | 4 ++- .../shapes/space_filler/SpaceFiller.js | 6 ++-- .../tessellation_twist/TessellationTwist.js | 7 +++- .../shapes/v1_engineering/V1Engineering.js | 4 +++ 13 files changed, 65 insertions(+), 24 deletions(-) diff --git a/src/features/layers/LayerEditor.js b/src/features/layers/LayerEditor.js index 6eed4a46..7016571a 100644 --- a/src/features/layers/LayerEditor.js +++ b/src/features/layers/LayerEditor.js @@ -33,18 +33,23 @@ const LayerEditor = () => { } const link = model.link const linkText = model.linkText || "here" - const renderedLink = link ? ( -
- See{" "} - - {linkText} - for more information. -
- ) : undefined + const description = model.description ? model.description + " " : "" + + const renderedLink = + link || description ? ( +
+ {description} + See{" "} + + {linkText} + {" "} + for more information. +
+ ) : undefined const handleChangeType = (selected) => { dispatch(changeModelType({ id: layer.id, type: selected.value })) @@ -206,11 +211,12 @@ const LayerEditor = () => { )} - {renderedLink}
+ + {renderedLink} ) } diff --git a/src/features/shapes/Epicycloid.js b/src/features/shapes/Epicycloid.js index 3bf028ac..ae0539c4 100644 --- a/src/features/shapes/Epicycloid.js +++ b/src/features/shapes/Epicycloid.js @@ -18,7 +18,9 @@ export default class Epicycloid extends Shape { super("epicycloid") this.label = "Clover" this.link = "http://mathworld.wolfram.com/Epicycloid.html" - this.linkText = "Epicycloid at Wolfram Mathworld" + this.linkText = "Wolfram Mathworld" + this.description = + "The clover shape is actually an epicycloid. Imagine two circles, with an outer circle rolling around an inner one. The path created by a point on the outer circle as it rolls is called an epicycloid." } getInitialState() { diff --git a/src/features/shapes/Heart.js b/src/features/shapes/Heart.js index 6d3c5c97..86d36043 100644 --- a/src/features/shapes/Heart.js +++ b/src/features/shapes/Heart.js @@ -5,8 +5,10 @@ export default class Heart extends Shape { constructor() { super("heart") this.label = "Heart" + this.description = + "Heart curves can be defined mathematically a number of different ways. Our heart shape is a parametric equation." this.link = "http://mathworld.wolfram.com/HeartCurve.html" - this.linkText = "HeartCurve at Wolfram Mathworld" + this.linkText = "Wolfram Mathworld" } getInitialState() { diff --git a/src/features/shapes/Hypocycloid.js b/src/features/shapes/Hypocycloid.js index 8671f88b..1f61088a 100644 --- a/src/features/shapes/Hypocycloid.js +++ b/src/features/shapes/Hypocycloid.js @@ -18,7 +18,9 @@ export default class Star extends Shape { super("hypocycloid") this.label = "Web" this.link = "http://mathworld.wolfram.com/Hypocycloid.html" - this.linkText = "Hypocycloid at Wolfram Mathworld" + this.linkText = "Wolfram Mathworld" + this.description = + "The web shape is actually an hypocycloid. Imagine two circles, with an inner circle rolling around inside an outer one. The path created by a point on the inner circle as it rolls is called an hypocycloid." } getInitialState() { diff --git a/src/features/shapes/NoiseWave.js b/src/features/shapes/NoiseWave.js index e72f7237..43080baf 100644 --- a/src/features/shapes/NoiseWave.js +++ b/src/features/shapes/NoiseWave.js @@ -35,6 +35,10 @@ export default class NoiseWave extends Shape { this.selectGroup = "Erasers" this.usesMachine = true this.autosize = false + this.link = "https://en.wikipedia.org/wiki/Perlin_noise" + this.linkText = "Wikipedia" + this.description = + "Perlin noise is a type of gradient noise that can be used to generate textures and terrain. Here we use it to create an appealing series of wavy lines." } canMove(state) { diff --git a/src/features/shapes/Reuleaux.js b/src/features/shapes/Reuleaux.js index 35c71389..0140e260 100644 --- a/src/features/shapes/Reuleaux.js +++ b/src/features/shapes/Reuleaux.js @@ -13,6 +13,10 @@ export default class Reuleaux extends Shape { constructor() { super("reuleaux") this.label = "Reuleaux" + this.description = + "A reuleaux polygon is a curve of constant width made up of circular arcs of constant radius. It's named after Frances Reuleaux, a 19th century German engineer who used Reuleaux triangles in his designs." + this.link = "https://en.wikipedia.org/wiki/Reuleaux_polygon" + this.linkText = "Wikipedia" } getInitialState() { diff --git a/src/features/shapes/Rose.js b/src/features/shapes/Rose.js index 8bf76db2..98867301 100644 --- a/src/features/shapes/Rose.js +++ b/src/features/shapes/Rose.js @@ -18,8 +18,10 @@ export default class Rose extends Shape { constructor() { super("rose") this.label = "Rose" - this.link = "http://mathworld.wolfram.com/Rose.html" - this.linkText = "Rose at Wolfram Mathworld" + this.link = "https://mathworld.wolfram.com/RoseCurve.html" + this.linkText = "Wolfram Mathworld" + this.description = + "A rose curve is a curve which has the shape of a petalled flower." } getInitialState() { diff --git a/src/features/shapes/circle_packer/CirclePacker.js b/src/features/shapes/circle_packer/CirclePacker.js index b47f7122..33f19a97 100644 --- a/src/features/shapes/circle_packer/CirclePacker.js +++ b/src/features/shapes/circle_packer/CirclePacker.js @@ -41,6 +41,10 @@ export default class CirclePacker extends Shape { this.usesMachine = true this.autosize = false this.selectGroup = "Erasers" + this.link = "https://en.wikipedia.org/wiki/Circle_packing" + this.linkText = "Wikipedia" + this.description = + "Circle packing is an arrangement of circles of varying sizes such that no overlapping occurs and no circle can be enlarged without creating an overlap." } canMove(state) { diff --git a/src/features/shapes/fractal_spirograph/FractalSpirograph.js b/src/features/shapes/fractal_spirograph/FractalSpirograph.js index e810a8cf..2fc50b14 100644 --- a/src/features/shapes/fractal_spirograph/FractalSpirograph.js +++ b/src/features/shapes/fractal_spirograph/FractalSpirograph.js @@ -34,8 +34,10 @@ export default class FractalSpirograph extends Shape { super("fractalSpirograph") this.label = "Fractal spirograph" this.link = - "https://benice-equation.blogspot.com/2012/01/fractal-spirograph.html" - this.linkText = "this blog post on benice equations" + "https://softologyblog.wordpress.com/2017/02/27/fractal-spirographs/" + this.linkText = "this blog post" + this.description = + "Fractal spirographs are generated by a series of circles rotating around each other. The pattern is created by tracking a point as it rolls along the outermost circle." } getInitialState() { diff --git a/src/features/shapes/lsystem/LSystem.js b/src/features/shapes/lsystem/LSystem.js index 4313c732..7aaf24ef 100644 --- a/src/features/shapes/lsystem/LSystem.js +++ b/src/features/shapes/lsystem/LSystem.js @@ -34,7 +34,9 @@ export default class LSystem extends Shape { super("lsystem") this.label = "Fractal line writer" this.link = "https://en.wikipedia.org/wiki/L-system" - this.linkText = "L-systems at Wikipedia" + this.linkText = "Wikipedia" + this.description = + "The fractal line writer shape is actually a Lindenmayer (or L) system. L-systems chain symbols together to specify instructions for moving in a 2d space (e.g., turn left or right, walk left or right). When applied recursively, they generate fractal-like patterns." } getInitialState() { diff --git a/src/features/shapes/space_filler/SpaceFiller.js b/src/features/shapes/space_filler/SpaceFiller.js index 3d3ea87c..7e314370 100644 --- a/src/features/shapes/space_filler/SpaceFiller.js +++ b/src/features/shapes/space_filler/SpaceFiller.js @@ -37,8 +37,10 @@ export default class SpaceFiller extends Shape { this.usesMachine = true this.autosize = false this.selectGroup = "Erasers" - this.linkText = "Fractal charm: space filling curves" - this.link = "https://www.youtube.com/watch?v=RU0wScIj36o" + this.linkText = "Wikipedia" + this.description = + "A space-filling curve draws a single, continuous line that covers every point in a space without missing any spots or crossing itself." + this.link = "https://en.wikipedia.org/wiki/Space-filling_curve" } canMove(state) { diff --git a/src/features/shapes/tessellation_twist/TessellationTwist.js b/src/features/shapes/tessellation_twist/TessellationTwist.js index 01c602bf..c6e2e3da 100644 --- a/src/features/shapes/tessellation_twist/TessellationTwist.js +++ b/src/features/shapes/tessellation_twist/TessellationTwist.js @@ -83,11 +83,16 @@ const options = { }, } -// Adapted from https://codepen.io/rafaelpascoalrodrigues/pen/KpBJve. See NOTICE for licensing details. +// Adapted from https://codepen.io/rafaelpascoalrodrigues/pen/KpBJve. +// See LICENSE for licensing details. export default class TessellationTwist extends Shape { constructor() { super("tessellationTwist") this.label = "Tessellation twist" + this.link = "https://en.wikipedia.org/wiki/Tessellation" + this.linkText = "Wikipedia" + this.description = + "The tessellation twist shape is form of tessellation. Tessellations cover a surface using tiles (in our case an equilateral triangle) with no overlaps or gaps." } getInitialState() { diff --git a/src/features/shapes/v1_engineering/V1Engineering.js b/src/features/shapes/v1_engineering/V1Engineering.js index 6ac51303..2b94aa9a 100644 --- a/src/features/shapes/v1_engineering/V1Engineering.js +++ b/src/features/shapes/v1_engineering/V1Engineering.js @@ -5,6 +5,10 @@ export default class V1Engineering extends Shape { constructor() { super("v1Engineering") this.label = "V1Engineering" + this.link = "https://www.v1e.com/" + this.linkText = "V1 Engineering" + this.description = + "This shape represents the V1 Engineering logo. V1 Engineering provides low-cost, customizable machine designs. Sandify was created in 2017 by users in their forum." } getInitialState() { From eabac2f718c329e852066a0f48872d2ea9e1748e Mon Sep 17 00:00:00 2001 From: Jeffeb3 Date: Thu, 13 Jun 2024 12:27:12 -0600 Subject: [PATCH 4/4] Minor text changes. --- src/features/shapes/Epicycloid.js | 2 +- src/features/shapes/Hypocycloid.js | 2 +- src/features/shapes/lsystem/LSystem.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/shapes/Epicycloid.js b/src/features/shapes/Epicycloid.js index ae0539c4..048b6eed 100644 --- a/src/features/shapes/Epicycloid.js +++ b/src/features/shapes/Epicycloid.js @@ -20,7 +20,7 @@ export default class Epicycloid extends Shape { this.link = "http://mathworld.wolfram.com/Epicycloid.html" this.linkText = "Wolfram Mathworld" this.description = - "The clover shape is actually an epicycloid. Imagine two circles, with an outer circle rolling around an inner one. The path created by a point on the outer circle as it rolls is called an epicycloid." + "The clover shape is an epicycloid. Imagine two circles, with an outer circle rolling around an inner one. The path created by a point on the outer circle as it rolls is called an epicycloid." } getInitialState() { diff --git a/src/features/shapes/Hypocycloid.js b/src/features/shapes/Hypocycloid.js index 1f61088a..6ee729b1 100644 --- a/src/features/shapes/Hypocycloid.js +++ b/src/features/shapes/Hypocycloid.js @@ -20,7 +20,7 @@ export default class Star extends Shape { this.link = "http://mathworld.wolfram.com/Hypocycloid.html" this.linkText = "Wolfram Mathworld" this.description = - "The web shape is actually an hypocycloid. Imagine two circles, with an inner circle rolling around inside an outer one. The path created by a point on the inner circle as it rolls is called an hypocycloid." + "The web shape is a hypocycloid. Imagine two circles, with an inner circle rolling around inside an outer one. The path created by a point on the inner circle as it rolls is called a hypocycloid." } getInitialState() { diff --git a/src/features/shapes/lsystem/LSystem.js b/src/features/shapes/lsystem/LSystem.js index 7aaf24ef..df5ace94 100644 --- a/src/features/shapes/lsystem/LSystem.js +++ b/src/features/shapes/lsystem/LSystem.js @@ -36,7 +36,7 @@ export default class LSystem extends Shape { this.link = "https://en.wikipedia.org/wiki/L-system" this.linkText = "Wikipedia" this.description = - "The fractal line writer shape is actually a Lindenmayer (or L) system. L-systems chain symbols together to specify instructions for moving in a 2d space (e.g., turn left or right, walk left or right). When applied recursively, they generate fractal-like patterns." + "The fractal line writer shape is a Lindenmayer (or L) system. L-systems chain symbols together to specify instructions for moving in a 2d space (e.g., turn left or right, walk left or right). When applied recursively, they generate fractal-like patterns." } getInitialState() {