Jump to content

Measure length of a section curve


---
 Share

Recommended Posts

I have created a section from a plane through my mesh and I wish to calculate the length of the curve created from this cross-section. Is this possible?

image.thumb.png.d65e0f9dd4d9a46358fb95dd2ef76b0d.png

Link to comment
Share on other sites

I think you can take the sum of the distances between each point in the section 

# -*- coding: utf-8 -*-

import gom

total_dist=0
section=gom.app.project.actual_elements['Plane 1 +0.00 mm']

for i in range(0, len(section.coordinate)-1):
	total_dist+=(abs(section.coordinate[i+1].x-section.coordinate[i].x)+abs(section.coordinate[i+1].y-section.coordinate[i].y)+abs(section.coordinate[i+1].z-section.coordinate[i].z))

print(total_dist)

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...