Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape, CAD, maker project and design.
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.

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;
import(path : "onshape/std/geometry.fs", version : "559.0");
annotation { "Feature Type Name" : "My Feature" }
export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "My Angle" }
isAngle(definition.myAngle, ANGLE_360_BOUNDS);
}
{
var list = [];
for (var phi = 0 * degree; phi < definition.myAngle; phi += 1 * degree)
{
list = append(list, phi);
}
list = append(list, list[0]);
debug(context, size(list));
});
0
Comments
Would it fix it if you divided by degree before doing the for loop?