Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Strange behavior of FOR loop for real iterator.
konstantin_shiriazdanov
Member Posts: 1,221 ✭✭✭✭✭
in this simple test feature i reproduced the sutuatuin when number of iterations
of my loop is +2 bigger then one would expect for test values bigger then 127 degrees
https://cad.onshape.com/documents/c0429467b6e5c445825d5e38/w/4ac0768c5fbd908e4dd309f6/e/d53b7f0578bcaaa9835d8461
of my loop is +2 bigger then one would expect for test values bigger then 127 degrees
https://cad.onshape.com/documents/c0429467b6e5c445825d5e38/w/4ac0768c5fbd908e4dd309f6/e/d53b7f0578bcaaa9835d8461
FeatureScript 559;<br>import(path : "onshape/std/geometry.fs", version : "559.0");<br><br>annotation { "Feature Type Name" : "My Feature" }<br>export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)<br> precondition<br> {<br> annotation { "Name" : "My Angle" }<br> isAngle(definition.myAngle, ANGLE_360_BOUNDS);<br><br> }<br> {<br> var list = [];<br> for (var phi = 0 * degree; phi < definition.myAngle; phi += 1 * degree)<br> {<br> list = append(list, phi);<br> }<br><br> list = append(list, list[0]);<br> debug(context, size(list));<br> });
0
Comments
Would it fix it if you divided by degree before doing the for loop?
IR for AS/NZS 1100