Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Centroid of child components in Assembly

KinKin Member Posts: 28 PRO
Is there anyway to Extract centroid of child components in Assembly using API?

Comments

  • caden_armstrongcaden_armstrong Member, User Group Leader Posts: 127 ✭✭✭
    edited October 2022
    You could:
    1. evaluate the centroid of each component in the context of it's part studio, using the evaluated featurescript endpoint.
    2. Translate that centroid using the transformation of the component in the assembly from the getassembly endpoint

    If you are trying to find the centroid of all child components collectively,
    3. You could then sum all of those centroids from #2, weighted against the mass of each component.

    If you are looking for a featurescript only way of doing it,
    You could make a featurescript that takes in bodies and calculates the centroid, and just run it in an incontext part studio in the context of the assembly. This is probably the easiest way of doing it.
  • KinKin Member Posts: 28 PRO
    Thanks Caden. 
Sign In or Register to comment.