closestPtPolyline( Point, Polyline )Here is an example:
- Returns
- <e3Pt> Create a 3D point that is the closest point on the polyline to the space point.
- Point
- <e3Pt> A point in space.
- Polyline
- <polyline> A polyline in space.
# The polyline in space. l : polyline( pt( 0, 0, 0), pt( 0.5, 0.5, 0.0), pt( 1.0, -0.2, 0.0), pt( 1.0, 0.2, 0.4) ); # The space point sp : pt( 0.5, 0.7, 0.0 ); # The closest point on the polyline to sp. d : closestptpolyline( sp, l ); show(l,sp,d,polyline(sp,d));
closestPtCrv( Point, Curve )
- Returns
- <e3Pt> Returns a real number that is the parametric value of the closest point on the curve to the space point.
- Point
- <e3Pt> A point in space.
- Polyline
- <curve> A curve in space.
closestPtSrf( Srf, Point, Eps )
- Returns
- <e3Pt> Returns a parametric point that is the parametric value of the closest point on the surface to the space point.
- Srf
- <surface> A surface in space.
- Point
- <e3Pt> A point in space.
- Eps
- <number> A tolerance number.
baryCoords( Triangle, Point )Here is an example:
- Returns
- <e3Pt> Create a 3D point that holds the 3 barycentric coordinates of the point in the triangle.
- Triangle
- <arrayOf point> An array of 3 points defining the triangle.
- Point
- <e3Pt> The point in the plane of the triangle.
t1 : pt(0,0,0); t2 : pt(1,0,0); t3 : pt(0,0.8,0); tri : polyline( t1, t2, t3, t1 ); p : pt( 0.5, 0.3, 0.0 ); show( tri, p ); bary : baryCoords( array( t1, t2, t3 ), p ); backToEuclidSpace : ptBlend( array( t1, t2, t3 ), array( bary.x, bary.y, bary.z )); # This should be the same point as p show( backToEuclidSpace );
closestPtOnTri( Triangle, Point )Here is an example:
- Returns
- <e3Pt> Create the point on the triangle closest to Point.
- Triangle
- <arrayOf point> An array of 3 points defining the triangle.
- Point
- <e3Pt> The point in space.
t1 : pt(0,0,0); t2 : pt(1,0,0); t3 : pt(0,0.8,0); tri : polyline( t1, t2, t3, t1 ); p : pt( 0.5, 0.3, 0.5 ); show( tri, p ); closest : closestPtOnTri( array( t1, t2, t3 ), p ); closestline : polyline( p, closest ); show( closestline ); p : pt( 0.8, 0.8, 0.5 );
closestPtTriPolyObj( Point, Polyline )Here is an example:
- Returns
- <e3Pt> Create a 3D point that is the closest point on the polyline to the space point.
- Point
- <e3Pt> A point in space.
- Polyline
- <polyline> A polyline containing triangles.
# The polyline in space. l : polyfromtri("/res/alpha1/src/a1src/data/tri_models/bun1.tri")$; # The space point sp : pt( 5, 7, 10.0 ); # The closest point on the polyline to sp. d : closestpttripolyobj( sp, l ); show(l,sp,d,polyline(sp,d));
closestPtConvexSets( Set1, Set2 )Here is an example:
- Returns
- <group> Construct a group of the two points that define the minimum separation.
- Set1
- <arrayOf point> An array holding the vertices of a convex set.
- Set2
- <arrayOf point> An array holding the vertices of a convex set.
a : pt(0,0,0.2); b : pt(1,0,0); c : pt(0,0.8,0); d : pt(0.5, 0.3, 0.3 ); s1 : polyline(a,b,c,a,d,c,d,b); x : pt( 1.1, 0.7, -0.2 ); y : pt( 0.7, 0.5, 0.1 ); z : pt( 0.7, 0.2, 0.5 ); w : pt( 0.8, 0.7, 0.2 ); s2 : polyline( x,y,z,x,w,y,w,z ); show( s1, s2 ); clpts : closestPtConvexSets( array(a,b,c,d), array(x,y,z,w) ); minSepLine : polyline( clpts[0], clpts[1] ); show( minSepLine );
closestPtCtlMesh( Srf, Point )Here is an example:
- Returns
- <e3Pt> Construct a point that is the closest point on the control mesh of Srf to Point.
- Srf
- <surface> A surface with a ctl mesh.
- Point
- <e3Pt> A space point.
flat : flatsrf( 3, 3,10,5)$; warp : warp( flat, vec(0.0,0.0,0.9), pt( 0.0, 0.0, 0.0 ), 1.15, 0.9, 1 )$; pt : pt( 0.4, 0.5, 0.9); meshpt : closestptctlmesh( warp, pt ); # Use display parameters to look at the ctl mesh of warp. show( warp, pt, meshpt );
nodalMap( Srf, Point )Here is an example:
- Returns
- <e3Pt> Construct a point that holds the u,v nodal mapping of the Point on the Srf.
- Srf
- <surface> A surface with a ctl mesh.
- Point
- <e3Pt> A space point.
flat : flatsrf( 3, 3,10,5)$; warp : warp( flat, vec(0.0,0.0,0.9), pt( 0.0, 0.0, 0.0 ), 1.15, 0.9, 1 )$; pt : pt( 0.4, 0.5, 0.9); uvpt : nodalmap(warp, pt); srfpt : srfeval(warp, uvpt.x, uvpt.y ); # Use display parameters to look at the ctl mesh of warp. show( warp, pt, srfpt );