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.
Howto set a point/ball into the center of mass?
wolfgang_maier                
                
                    Member Posts: 39 ✭✭✭                
            Hello,
howto set a point/ball into the center of mass of a solid.
regards
Wolfgang
0    
            
Comments
FeatureScript 877; import(path : "onshape/std/geometry.fs", version : "877.0"); annotation { "Feature Type Name" : "C of G" } export const myFeature = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Select part", "Filter" : EntityType.BODY && BodyType.SOLID, "MaxNumberOfPicks" : 1 } definition.Part is Query; } { var point = evApproximateCentroid(context, { "entities" : definition.Part }); var sketch = newSketchOnPlane(context, id, { "sketchPlane" : plane(point, vector(0, 0, 1)) }); var pt = skPoint(sketch, "point1", { "position" : vector(0, 0) * meter }); skSolve(sketch); debug(context, point); });This one should be published, good job!
FeatureScript 877; import(path : "onshape/std/geometry.fs", version : "877.0"); annotation { "Feature Type Name" : "C of G" } export const myFeature = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Select part", "Filter" : EntityType.BODY && BodyType.SOLID, "MaxNumberOfPicks" : 1 } definition.Part is Query; } { opPoint(context, id + "point1", { "point" : evApproximateCentroid(context, { "entities" : definition.Part })}); });why does the documentation say "Warning: This is an approximate value and it is not recommended to use this for modeling purposes". Any insight into what makes it "approximate"?
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com
Thanks for the answer. It definitely is strange to me, and now I have no idea how much to trust it. I guess I'll just avoid it for life-and-death designs
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com