Comments (3)
var involuteGear = new involuteGear(params);
involuteGear.pitchRadius = 15;
This will change the pitchRadius property, but nothing more than that. Remember that the other properties, and also the resulting polygons, don't change when you change the pitchRadius:
var foo = 5;
var bar = foo * 5;
foo = 10;
console.log(bar); // prints 25
The current gear example code isn't well suited for what you want. You need to rebuild the complete model if you change a thing. So when you update something:
var changedInvoluteGear = new involuteGear(changedParams);
I haven't looked much into OpenJSCad yet, but I don't believe there's another way to deal with changing parameters than with this.
If you want to change the way involuteGear works from time to time, you may do some prototypal inheritance
from openjscad.org.
Thanks for the feedback! I only need the the number of teeth, thickness, and center hole info for each gear. So would it be appropriate to separate these functions out as a prototype method and process them first?
from openjscad.org.
I can think of two options...
- Move the variables outside the function. This makes the variables "global" and can be accessed easily.
- Change the function to set a property on given parameter, i.e. return the calculated value as a property
So, you'll have to change the code.
from openjscad.org.
Related Issues (20)
- Balloons appear to be regenerating after toggling dropdown menu on jscad.app HOT 1
- V3 : test IO translations
- Union of 2D polygon and its mirrorX doesn't work HOT 1
- V3: parameter definitions
- subtracting extrudeHelical object (like threads) from a cube does not work as expected HOT 4
- Geometry is not closed error
- Vertices get merged unexpectedly HOT 5
- Select in parameters does not match other inputs style HOT 2
- JSCAD GUI does not cleanup messages for repeated SHIFT+ENTER on same script
- Feature request: openjscad.xyz/?uri= support for "data" scheme in addition to "http(s)" HOT 7
- Feature request: custom mouse controls HOT 1
- Typo in example
- plane.fromPoints() implementation buggy HOT 5
- V2 backwards compatibility with V1 HOT 15
- @jscad/stl-deserializer in the browser? HOT 7
- stl-deserializer having issues with some STLs HOT 4
- https issue and/or openjscad.xyz domain expired? HOT 9
- Keyboard Shortcuts Some Not Working HOT 1
- jscad cli does not work via clean install on fresh linux machine HOT 1
- 3D quickhull() does not always work correctly when all vertices are in same plane HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openjscad.org.