Skip to content

Boundary Dilation and Triangle Ribbon Extension #280

@waqashussain117

Description

@waqashussain117

Boundary Extension Difference

They work in two different ways.

Extend surface
In view_3d.py, the tool actually creates new mesh geometry.

Flow:

It cleans the selected TriSurf mesh first with clean_topology().
It converts the user input into a displacement vector in _resolve_extension_displacement()
It finds the open boundary edges with _collect_trisurf_boundary_edges()
It splits those boundary edges into “positive”, “negative”, or “both” boundary sets with _select_trisurf_boundary_edge_sets()
For every selected boundary edge, it creates shifted copies of the edge endpoints.
It connects original edge + shifted edge into a quad, then splits that quad into 2 triangles.
Those new triangles are appended to the original mesh, so the surface becomes larger.
In conclusion, it adds a ribbon of new triangles along the open border.

STL with 1m dilation
In stl2vtk.py, export calls vtk_entity.boundary_dilation(tol=tol) before writing STL. The real logic is in entities_factory.py

Flow:

It cleans the mesh topology.
It extracts only the boundary edges using vtkFeatureEdges.
It gets the boundary point ids.
For each boundary point, it inspects the triangles touching that point.
For each boundary edge in those triangles, it computes an outward direction that stays in the triangle plane:
edge direction
triangle center to edge-center direction
triangle normal from their cross product
outward in-plane offset from another cross product
It sums these outward directions for the point.
It normalizes the result and scales it by tol such as 1.0 m.
It moves the existing boundary point to the new position.
So this is not adding triangles. It just pushes boundary vertices outward.

Main difference

Extend surface: adds new cells and grows the mesh in a chosen direction.
boundary_dilation: moves existing boundary points outward based on local triangle geometry.

At the moment, I tested both and for the sake of workflow and paper, I will keep them both in its current state, then I will test both to see which one is the best and we can select one with the best output. I am tightening the geometry tolerance in the Extension Surface in View3D to see how it works.

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions