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.
Create a query from a Z_AXIS
monroe_weber_shirk
Member Posts: 102 EDU
I am using circularPattern in FeatureScript. It requires the axis of rotation as a query. I want to rotate around the Z_AXIS. How do I convert the Z_AXIS into a query?
Tagged:
0
Comments
Example here:
const axis = Z_AXIS; var Ta = []; // Array of transforms to apply. var names = []; // Array of instance names. for (var i = 1; i < n; i += 1) { Ta = append(Ta, rotationAround(axis, i*360*degree / n)); names = append(names, toString(i)); } opPattern(context, patternId, { "entities" : qEntity, "transforms" : Ta, "instanceNames" : names });For patterning bodies and faces, this should produce the same result as using 'circularPattern'. A benefit is you aren't restricted to rotations about an axis.The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
default features should always exist. I am not saying this is the way to do it, but it is a way to do it.
qTopPlane(EntityType.FACE);
but you can also simply do this.
plane(vector(0,0,0)*meter,vector(0,0,1));
or
or even faster
plane( WORLD_ORIGIN,Z_AXIS,X_AXIS);
and even faster yet
{"origin":WORLD_ORIGIN,"normal": Z_AXIS,"x": X_AXIS} as Plane;// this i believe bypasses the plane function to normalize already normalized vectors.