Boundary of a stl surface

Everything DG Kernel: Technical discussions and issues
Post Reply
Gitesh Powar
Posts: 1
Joined: Fri Sep 06, 2024 12:28 am

Boundary of a stl surface

Post by Gitesh Powar »

Greetings,

I'm currently reading an stl file. What I want to do is given a triangular mesh of a non-closed surface, I would like to extract the points on the four boundary curves of the STL surface.
A simple example is a meshed plane where I would like only the points on the four boundary lines.

Is there a way to extract this information from an STL file?

Thanks
Anand Prashar
Posts: 1
Joined: Mon Sep 09, 2024 4:26 am

Re: Boundary of a stl surface

Post by Anand Prashar »

I think IVertex_DG.IsInteriorVertex is what you need.

Use IMesh_DG.GetVertexList(), then loop all and select ones which are not interior. It will give you a list.

Its order I expect will be random. Sorting it in, say CCW order will need more work. Sadly, there is no GetSegmentList() in IMesh_DG.

You can start with the first vertex in your list and use IVertex_DG.GetStarSegment(), IVertexSegment_DG.IsInterior(), IVertexSegment_DG.GetEnd()
to find the two adjacent boundary segments and the two adjacent vertices. Keep looping until the algorithms produces the same vertex on both sides.

You need only one boundary vertex in the first step to do this.

Make sure the mesh is in upgraded state before any of this.
Post Reply