You are here: Surpac Concepts > Macros > SCL > SWA Commands > SclTriangulateSegments
GEOVIA Surpac

SclTriangulateSegments

Overview

Generate a mesh of contiguous, non-overlapping, non-intersecting (in 3D space) triangles between two segments and assign the resultant triangles to a specified trisolation.

Synopsis

$Segment1Handle1 SclTriangulateSegments $Segment2Handle $ObjectId $TrisolationId

Description

Generate a mesh of triangles between 2 segments. The segments may be open or closed and have any geometric relationship to each other. The more widely variant the segment geometries the more peculiar the results are likely to be.

Arguments

  • Segment1Handle
  • Pass by value. The handle to the first segment for the generation of the triangle mesh.

  • Segment2Handle
  • Pass by value. The handle to the second segment for the generation of the triangle mesh.

  • ObjectId
  • Pass by value. The ID number of the object that is to be created. It is permissible to use an object number that already exists.

  • TrisolationId
  • Pass by value. The ID number of the trisolation that is to be created. It is permissible to use a trisolation number that already exists.

Returns

SCL_OK is the triangulation was successful. Throws a TCL error if the triangulation fails.

Examples

# create the swa and load the strings to be triangulated
SclCreateSwa SwaHandle TriangulateStrings
$SwaHandle SclSwaOpenFile segments1.str
# get the handles to the segments to be used in the triangulation
$SwaHandle SclCreateString StringHandle 1
$StringHandle SclCreateSegment Segment1Handle 0
$StringHandle SclCreateSegment Segment2Handle 1
# triangulate between the 2 segments
$Segment1Handle SclTriangulateSegments $Segment2Handle 1 1
# now triangulate inside each end segment
$Segment1Handle SclTriangulateInside 1 1
$Segment2Handle SclTriangulateInside 1 1
# save the results to a DTM & STR file
$SwaHandle SclSwaSaveDtmFile "tri_segments1.str"
# now destroy the swa
SclDestroy SwaHandle