Group Abstract Group Abstract

Message Boards Message Boards

0
|
251 Views
|
7 Replies
|
10 Total Likes
View groups...
Share
Share this post:

Find the cross section profile of an STL mesh

Posted 4 days ago

I am having issues extracting the intersecting profile of a mesh surface (STL) with a simple plane. See the image to understand my goal.
Brown: STL surface, Yellow: Plane, Red: Intersecting Profile

I applied RegionIntersection to the plane and each polygon.

The output is a list of Boolean regions that represent line segments, fine. However, discretizing a single line segment provides me with a list of both points and lines, or simply fails to be evaluated.

How can I discretize each of these Boolean regions in order to get usable line segments? Or better yet, is there another approach to creating this cross section profile altogether?

P.S. I have already attempted to use the mesh edges instead of the polygons, then recreated the profile from the points created by Regionintersection. This causes headaches later on that I'm hoping to avoid.

POSTED BY: Stuart Cowper
7 Replies

POSTED BY: Mohammad Bahrami
Posted 3 days ago

This is exactly what I was hoping for. I had done something similar where I found the intersecting points, but had no knowledge of using MeshConnectivityGraph or AssociationThread to pre-order them based on the polygons' edges.

Thanks for the help.

POSTED BY: Stuart Cowper

I do this regularly. My approach is to generate an interpolating function, typically using ListInterpolation or SpatialEstimate, based on the xyz coordinates of the surface mesh nodes (you can use MeshCoordinates to extract the xyz coordinates of your surface mesh). The interpolating function can then be used to derive z coordinate values at any number of xy points along a section line in the xy plane.

Here's an example...

POSTED BY: Ian Williams
Posted 3 days ago

Using Interpolation with order 1 is really clever. I didn't realize you could just turn the mesh into a function that way - will be helpful later on.

I should have explained that I need to evaluate the angle of each line segment in the cross section, which is easier if I keep them separate and avoid interpolating between points as is done when subsampling "nSectionPts".

Thank you for sharing the method and for the the great example.

POSTED BY: Stuart Cowper

I've updated the previous notebook to include slope angles along the section line. I've also shown a way of estimating slope angles for the entire surface – rather than just along a section line.

POSTED BY: Ian Williams

Wow! Using interpolation function is a very smart choice!

POSTED BY: Mohammad Bahrami

SpatialEstimate can also work well for this type of application. It offers greater flexibility than Interpolation which is limited to linear interpolation when data points don't conform to a regular grid.

POSTED BY: Ian Williams
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard