# How to calculate the center line of Cylinder and Cone？

**URL:** https://forum.techsoft3d.com/t/how-to-calculate-the-center-line-of-cylinder-and-cone/4199
**Category:** HOOPS Visualize Web
**Created:** [November 11, 2024, 9:07am UTC](https://forum.techsoft3d.com/t/how-to-calculate-the-center-line-of-cylinder-and-cone/4199 "2024-11-11T09:07:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![1012683648](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/1012683648/32/1689_2.png) [@1012683648](https://forum.techsoft3d.com/u/1012683648)
#### Post date: [November 11, 2024, 9:07am UTC](https://forum.techsoft3d.com/t/how-to-calculate-the-center-line-of-cylinder-and-cone/4199/1 "2024-11-11T09:07:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tino](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@tino](https://forum.techsoft3d.com/u/tino)
#### Post date: [November 11, 2024, 12:27pm UTC](https://forum.techsoft3d.com/t/how-to-calculate-the-center-line-of-cylinder-and-cone/4199/2 "2024-11-11T12:27:35Z")

</div>

You can try getting the bounding of the node using the function [getNodesBounding](https://docs.techsoft3d.com/communicator/latest/api_ref/viewing/classes/Model.html#Model.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.
