Version 0.59.0

Markers

The marker concept provides a way for defining points on the surfaces of solids. It is represented by the marker data type that gives an abstract handle to a defined point on the surface.

A marker can be placed with the mark() function of a solid . This requires a vector position on or closeby to the place the marker shall be added to.

Example

solid a = sphere()
marker mymarker = a.mark( <[1.0, 1.0, 1.0]> )

The marker is then attached to the solid's surface at the point that is closest to the given vector. It is possible to check whether the marker got attached via the is_attached() method of the marker :

Example

echo( mymarker.is_attached( a ) )

Output

true

Now the marker can be used to return certain information about its position:

Example

echo( "Position: " + mymarker.pos( a ) )
echo( "Normal: " + mymarker.normal( a ) )
echo( "Tangent vector 1: " + mymarker.t1( a ) )
echo( "Tangent vector 2: " + mymarker.t2( a ) )

Output

Position: <[0.29575717,0.28808953,0.27990726]>
Normal: <[0.62405576,0.53876196,0.56594166]>
Tangent vector 1: <[0.72274732,-0.12272949,-0.68012777]>
Tangent vector 2: <[-0.29696924,0.83347047,-0.4659788]>

Details are given in the marker reference section.

Tracking Solid Modifications

One important use case for markers is, to track surface points during one or more geometry modifications of the solid, what is possible with some limitations (see below). A solid that is a (modified) copy inherits all markers of its ancestor. The following example performs a scaling of sphere a and thus generates a modified copy b of it:

Example

solid b = scaling( 1.0, 1.0, 2.0 ) >> a

Marker mymarker got copied implicitly onto b and can now be evaluated there as well:

Example

echo( mymarker.is_attached( b ) )
echo( "Position: " + mymarker.pos( b ) )
echo( "Normal: " + mymarker.normal( b ) )
echo( "Tangent vector 1: " + mymarker.t1( b ) )
echo( "Tangent vector 2: " + mymarker.t2( b ) )

Output

true
Position: <[0.29575717,0.28808953,0.55981453]>
Normal: <[0.71594349,0.61809079,0.32463626]>
Tangent vector 1: <[0.4677294,-0.079424979,-0.88029591]>
Tangent vector 2: <[-0.51831856,0.78208404,-0.34596303]>

As can be seen, the marker position and its correlated values transformed in the same way as the surface of the solid.

Note

Markers are a relatively new concept to trCAD. Therefore, they are currently not compatible with all operations available. Users should test, whether a given operation supports markers.

🗙

Search results for