TriangleGetSegmentMarkers
TriangleGetSegmentMarkers[expr]
returns the segment markers for a Triangle expression.
Details and Options
Examples
Basic Examples
See Also
Tech Notes
Related Guides
TriangleLink`
TriangleLink`
TriangleGetSegmentMarkers
TriangleGetSegmentMarkers[expr]
returns the segment markers for a Triangle expression.
Details and Options
- To use TriangleGetSegmentMarkers, you first need to load it using Needs["TriangleLink`"].
- TriangleGetSegmentMarkers returns the list of integers in a TriangleExpression that has been set with TriangleSetSegmentMarkers.
Examples
Basic Examples (1)
Needs["TriangleLink`"]This creates an instance of a Triangle expression:
inst = TriangleCreate[]This sets up points and facets to use:
pts = {{0., 0.}, {2., 0.}, {2., 2.}, {0., 1.}};
segments = {{1, 2}, {2, 3}, {3, 4}, {4, 1}};This sets the points and facets in the Triangle instance:
TriangleSetPoints[inst, pts];
TriangleSetSegments[inst, segments];This sets the point and segment markers:
TriangleSetPointMarkers[inst, {43, 43, 66, 66}];
TriangleSetSegmentMarkers[inst, {43, 2, 66, 3}];This carries out the triangulation, returning a new Triangle instance:
outInst = TriangleTriangulate[ inst, "pqa0.1"]This extracts the points and elements from the triangulation:
coords = TriangleGetPoints[outInst];
meshElements = TriangleGetElements[outInst];With the following support function, you can visualize the triangles:
TriangleWireframe[i_] := Line[ Flatten[ i[[All, #]]& /@ {{1, 2}, {2, 3}, {3, 1}}, 1]]Graphics[GraphicsComplex[coords, TriangleWireframe[meshElements]]]This extracts the segment markers:
segmentMarkers = TriangleGetSegmentMarkers[outInst]Visualize some of the surface points:
selectedPoints = {43, 66}
Graphics[GraphicsComplex[ coords, Line /@ Pick[TriangleGetSegments[outInst], segmentMarkers, #] ]& /@ selectedPoints]