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.
simple manipulator tutorial?
adamohern
Member, OS Professional Posts: 216 PRO
Is there a simple 3D manipulator tutorial or example anywhere? The extrude tool, for example, clearly implements manipulators, but it's an extremely complex tool, so it's hard to tell what a simpler example might look like. If not, is that something that could be created fairly quickly? I just want to haul simple length values around.
0
Comments
annotation { "Feature Type Name" : "Fake extrude", "Manipulator Change Function" : "fakeExtrudeManipulatorChange" } export const fakeExtrude = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Faces to extrude", "Filter" : EntityType.FACE } definition.faces is Query; annotation { "Name" : "My Length" } isLength(definition.depth, LENGTH_BOUNDS); annotation { "Name" : "Opposite direction", "UIHint" : "OPPOSITE_DIRECTION" } definition.shouldFlip is boolean; } { var extrudePlane is Plane = evFaceTangentPlane(context, { "face" : definition.faces, "parameter" : vector(0.5, 0.5) }); var extrudeManipulator is Manipulator = linearManipulator( extrudePlane.origin, extrudePlane.normal, definition.shouldFlip ? definition.depth : -definition.depth ); addManipulators(context, id, { "myManipulator" : extrudeManipulator }); opExtrude(context, id + "extrude1", { "entities" : definition.faces, "direction" : definition.shouldFlip ? extrudePlane.normal : -extrudePlane.normal, "endBound" : BoundingType.BLIND, "endDepth" : definition.depth }); }, {}); export function fakeExtrudeManipulatorChange(context is Context, definition is map, newManipulators is map) returns map { var newDepth is ValueWithUnits = newManipulators["myManipulator"].offset; definition.depth = abs(newDepth); definition.shouldFlip = newDepth > 0; return definition; }