Version 0.64.1

surface_curve::two_points

Creates a curve along the surface of a solid between two points.

Signatures

  •   curve two_points( solid solid, vector oP1_i, vector oP2_i )

Details

This function constructs a curve that follows the surface of a given solid from a start point oP1_i to an end point oP2_i.

The resulting curve approximates the shortest path on the surface within a guidance plane that gets autmatically defined by the input points and their normals.

Example

 #import( "surface_curve.sps" )

 // Input solid
 solid bunny = mesh( "meshes/bunny.stl" )
 make bunny

 // Generate curve path on the solid's surface between two points p1 and p2
 vector p1 = <[-0.06,0.045,0.042]>
 vector p2 = <[0.03,0.1,0.04]>
 curve path = surface_curve::two_points( bunny, p1, p2 )

 // Visualize curve path by extrude along it
 curve contour = <[0.0005, 0.0]> -> arc( <[0.0, 0.0]>, 2PI )
 make rgb(0,0,255) >> extrusion( contour, path )
 

The resulting curve on the bunny's surface.

Note

If the input points are not on the surface, they will be projected onto it. The result is not a true geodesic, but follows a guidance plane as closely as possible.

Return value

A curve object representing the path along the surface between the two points.

Parameters

solid

The solid whose surface the curve will follow.

oP1_i

The start point of the curve. This point should be near or on the surface of solid.

oP2_i

The end point of the curve. This point should be near or on the surface of solid.

🗙

Search results for