How to calculate the center line of Cylinder and Cone?

I got the faceEntity, which is of type Cone or Cylinder, and I need to calculate the center line, which is the center point of the circle at both ends of the cylinder. The parameter obtained by model.getFaceProperty has origin, but how should the other point be computed? Thanks for your support

You can try getting the bounding of the node using the function getNodesBounding. The bounding box will provide the length-wise vector from one end of the cone/cylinder to the other end (which you will need to calculcate). With the known center point plus this vector, you can calculate the center line.

1 Like