Package Documentation

Object: curve (The :surf Package)
Mixins: geometry-kernel-object-mixin, base-object

Description

A generalized NURBS curve. Usually used as a mixin in more specific curves.


Input Slots (optional)

built-from gdl curve

Specify this if you want this curve to be a clone of an existing curve. (note - this uses a shared underlying curve object, it does not make a copy)


color-decimal [from geometry-kernel-object-mixin] vector of three real numbers

The RGB color of this object as imported from an external format (e.g. IGES) or as specified in :display-controls. Defaults to the foreground color specified in *colors-default*. This message should not normally be overridden in user application code.


hidden? [from vanilla-mixin*] boolean

Indicates whether the object should effectively be a hidden-object even if specified in :objects. Default is nil.


iges-level [from geometry-kernel-object-mixin] integer

Synonym for the layer.


image-file [from base-object] pathname or string

Points to a pre-existing image file to be displayed instead of actual geometry for this object. Defaults to nil


layer [from geometry-kernel-object-mixin] integer

The primary IGES-compatible level (layer) on which this object resides. Defaults to the first of the levels. This slot can be overridden in user code to specify a new layer which will be written out when this object is exported with the IGES output-format.


levels [from geometry-kernel-object-mixin] list of integers

The IGES-compatible levels (layers) on which this object resides. GDL does not currently support writing out multiple levels (layers) through the IGES writer ; only the first of these will be output if the object is exported with the IGES output-format (please contact Genworks if you need all levels (layers) to be written out).


local-box [from base-object] list of two 3d points

The left front bottom and right rear top corners, in global coordinates, of the rectangular volume bounding this geometric object.


obliqueness [from base-object] 3x3 orthonormal matrix of double-float numbers

This is synonymous with the orientation.


onclick-function [from base-object] lambda function of zero arguments, or nil

If non-nil, this function gets invoked when the user clicks the object in graphics front-ends which may or may not support this functionality (see viewport-html-div).


root [from vanilla-mixin*] gdl instance

The root-level node in this object's ``tree'' (instance hierarchy).


safe-children [from vanilla-mixin*] list of gdl instances

All objects from the :objects specification, including elements of sequences as flat lists. Any children which throw errors come back as a plist with error information


strings-for-display [from vanilla-mixin*] string or list of strings

Determines how the name of objects of this type will be printed in most places. This defaults to the name-for-display (generally the part's name as specified in its parent), followed by an index number if the part is an element of a sequence.


uv-curve gdl curve object

The corresponding UV curve for the primary surface on which this curve lies, if any. If this is not a surface-curve, this will return an error.


visible-children [from vanilla-mixin*] list of gdl instances

Additional objects to display in Tatu tree. Typically this would be a subset of hidden-children. Defaults to NIL.



Input Slots (optional, settable)

tolerance number

Approximation tolerance for display purposes. Defaults to the tolerance of the built-from curve, if one exists, otherwise defaults to the *display-tolerance*.



Input Slots (optional, defaulting)

center [from base-object] 3d point

Indicates in global coordinates where the center of the reference box of this object should be located.


display-controls [from base-object] plist

May contain keywords and values indicating display characteristics for this object. The following keywords are recognized currently:

:color
color keyword from the *color-table* parameter, or an HTML-style hexidecimal RGB string value, e.g. "#FFFFFF" for pure white. Defaults to :black.
:line-thickness
an integer, defaulting to 1, indicating relative line thickness for wireframe representations of this object.
:dash-pattern
(currently PDF/PNG/JPEG only). This is a list of two or three numbers which indicate the length, in pixels, of the dashes and blank spaces in a dashed line. The optional third number indicates how far into the line or curve to start the dash pattern.


height [from base-object] number

Z-axis dimension of the reference box. Defaults to zero.


length [from base-object] number

Y-axis dimension of the reference box. Defaults to zero.


orientation [from base-object] 3x3 matrix of double-float numbers

Indicates the absolute Rotation Matrix used to create the coordinate system of this object. This matrix is given in absolute terms (i.e. with respect to the root's orientation), and is generally created with the alignment function. It should be an orthonormal matrix, meaning each row is a vector with a magnitude of one (1.0).


width [from base-object] number

X-axis dimension of the reference box. Defaults to zero.



Computed Slots

bounding-box [from base-object] list of two 3d points

The left front bottom and right rear top corners, in global coordinates, of the rectangular volume bounding the tree of geometric objects rooted at this object.


direction-vector 3d vector

The direction pointing from the start to the end.


end 3d point

The point returned by evaluating the curve function at u2.


on-surfaces list of gdl surfaces

The surfaces on which this curve lies.


start 3d point

The point returned by evaluating the curve function at u1.


success? boolean

This will be t if the curve is generated successfully, nil otherwise.


u-max number

The highest parameter value of the underlying mathematical definition for this parametric curve


u-min number

The lowest parameter value of the underlying mathematical definition for this parametric curve


u1 number

Equal to the natural u-min of the curve.


u2 number

Equal to the natural u-max of the curve.



Hidden Objects

first-derivative gdl curve

The first derivative of this curve. The degree will be one less than the degree of this curve.


second-derivative gdl curve

The second derivative of this curve. The degree will be two less than the degree of this curve.



GDL Functions

acceleration 3d vector

The given parameter evaluated on the second derivative curve of this curve. Note that this is only valid if this curve has degree of at least two (2), and will throw an error otherwise.

arguments:
parameter Number
The desired parameter to be evaluated on the second derivative curve

b-spline-data list of 3d points, list of numbers, list of numbers, and integer

Returns four values which are the control points, the weights, the knots, and the degree of the curve.


check-continuity either t or a plist of numbers with keys :distance, angle, :length

.

keyword arguments:
3d-tolerance Allowed maximum distance between curve segments, Default Value: *3d-tolerance-default*
angle-tolerance Allowed maximum angle in radians between end/start tangents of curve segments, Default Value: *angle-tolerance-default
minimum-segment-length Allowed minimum curve segment length, Default Value: *minimum-segment-length-default*

closure keyword symbol, :closed, :open, or :continuous

continuous:
if ends are within *3d-tolerance-default* and tangents are within *angle-tolerance-default*, :closed if ends are within *3d-tolerance-default* but tangents are not within *angle-tolerance-default*, and :open if ends are not within *3d-tolerance-default*.

curvature number

The reciprocal of the radius of curvature at the given parameter.


curve-intersection-point surface point

First point of intersection between this curve and the other curve given as the argument. This function also returns a second value, which is a surface point representing the end of a contiguous segment, if any, associated with the surface point given as the primary return value. A NIL value as this second return value indicates that there was no contiguous segment, only an intersecting point as indicated by the surface point given as the primary return value.

arguments:
other-curve GDL Curve
The curve with which to intersect
keyword arguments:
distance-tolerance Number, Default Value: *3d-tolerance-default*
Distance for two points to be considered coincident
note:
use get-parameter-of and get-3d-point-of to extract components of a surface point.

curve-intersection-points surface points

Points of intersection between this curve and another curve. This function also returns a second value, which is a list of surface points representing the ends of contiguous segments, if any, associated with the surface point in the same position in the primary returned list. NIL values in this second returned list indicate that there was no contiguous segment, only an intersecting point as indicated by the surface point in the primary returned list.

arguments:
other-curve GDL Curve
The curve with which to intersect
keyword arguments:
distance-tolerance Number, Default Value: *3d-tolerance-default*
Distance for two points to be considered coincident
note:
use get-parameter-of, get-3d-point-of, and get-uv-point-of to extract components of a surface point.

dropped-curve list of plists

The returned list of plists contains information about the points where the tangents of this curve and those of the curve given as the argument are equal.

arguments:
curve GDL Curve object

dropped-point surface point

Given a 3D point, returns the point(s) projected normally onto the curve.

keyword arguments:
distance-tolerance Number, Default Value: [covers
The 3D point must be within this distance of the curve for a successful drop

equi-spaced-parameters list of numbers

Returns the specified number of parameters equally spaced along the curve.

arguments:
number Number
How many parameters to return
keyword arguments:
spacing Keyword Symbol, :parametric or :arc-length, Default Value: :arc-length
:arc-length is the default

equi-spaced-points list of 3d points

Returns the specified number of points equally spaced along the curve.

arguments:
number Number
How many points to return
keyword arguments:
spacing Keyword Symbol, :parametric or :arc-length, Default Value: :arc-length
Defaults to :arc-length
arc-length-approximation-tolerance Number, Default Value: *zero-epsilon*
A smaller number gives tighter arc length approximation. Scaled to curve exent

in-plane? boolean

Given a point and a vector defining a plane, returns T or NIL depending whether this curve lies in the plane. Also returns a second value which is the maximum distance of the curve from the plane.

arguments:
plane-point 3d-point
Point on the plane
plane-normal 3d-vector
Normal vector of the plane
keyword arguments:
distance-tolerance Number, Default Value: *3d-tolerance-default*
Allowed distance of any point on the curve from the plane

local-bounding-box

Returns a bbox object, answering xmin, ymin, zmin, xmax, ymax, and zmax, for a box containing the convex hull (i.e. the control points) of this curve and oriented according to the given center and orientation.


maximum-distance-to-curve plist

The returned plist contains information about the maximum distance from this curve to the curve given as the argument.

arguments:
curve GDL Curve object

maximum-distance-to-point plist

The returned plist contains information about the maximum distance from this curve to the point given as the argument.

arguments:
point 3D Point

minimum-distance-to-curve plist

The returned plist contains information about the minimum distance from this curve to the curve given as the argument.

arguments:
curve GDL Curve object

minimum-distance-to-point plist

The returned plist contains information about the minimum distance from this curve to the point given as the argument.

arguments:
point 3D Point

minimum-radius number

The minimum radius of curvature for the curve. A second value is also returned, which is a surface point indicating the point on the curve where this minimum radius occurs. A third value is also returned, which is a list of additional curve parameters where similar minimum radii occur.


normal 3d vector

The normal of the curve at the given parameter value, i.e. the vector pointing from the point on the curve at this parameter to the center of the osculating circle at that point. if the curve has no curvature at the given parameter, NIL is returned.

arguments:
parameter Number
The desired parameter to be evaluated on the curve

offset-point-along surface point

Returns point at given parameter offset by given distance.

arguments:
curve-parameter Number
The curve parameter to start from
distance Number
The distance to offset

on? boolean

Returns non-NIL if the given parameter lies within the parameter range of this curve.

arguments:
parameter Number
The parameter to be tested

parameter-at-length number

Returns the parameter representing a point offset from the start of the curve by the given length.

arguments:
distance Number
The arc length from the start

parameter-at-point number

Returns the parameter of the given point on the curve.

arguments:
point Point
The point of which the parameter should be calculated

parameter-bounds numbers (multiple return values)

The minimum and maximum parameter values for this parametric curve.


plane-intersection-point surface point

First point of intersection between this curve and the plane denoted by plane-point and plane-normal

note:
use get-parameter-of and get-3d-point-of to extract components of a surface point.

plane-intersection-points surface points

Points of intersection between this curve and the plane denoted by plane-point and plane-normal.

note:
use get-parameter-of and get-3d-point-of to extract components of a surface point.

point 3d point

The point on the curve corresponding to the given parameter value.

arguments:
parameter Number
The desired parameter to be evaluated on the curve

radius-of-curvature number

The radius of curvature (i.e. radius of the osculating circle) at the given parameter.

arguments:
parameter Number
The parameter at which to compute radius of curvature

surface-intersection-point surface point

Returns the first point of intersection between this curve and the surface given as an argument.

arguments:
surface GDL Surface object
The surface to intersect with this curve
keyword arguments:
3d-tolerance Number, Default Value: *3d-tolerance-default*
The tolerance to use for intersecting

surface-intersection-points list of surface points

Returns the point(s) of intersection between this curve and the surface given as an argument.

arguments:
surface GDL Surface object
The surface to intersect with this curve
keyword arguments:
3d-tolerance Number, Default Value: *3d-tolerance-default*
The tolerance to use for intersecting

tangent 3d vector

The curve tangent at the given parameter value. Supplementary values returned are: the 3D point at the parameter value. If keyword argument :include-curvature? is given as non-NIL, the radius of the osculating circle, the center for the osculating circle, the normal for the osculating circle, and the curve normal are also returned. Note: If :include-curvature? is given as non-NIL and the curve has no curvature at the specified parameter, NIL is returned for each of these four values.

arguments:
parameter Number
The desired parameter to be evaluated on the curve
keyword arguments:
include-curvature? Boolean (T or NIL), Default Value: nil
Indicates whether to compute curvature information

tangent-points list of plists

The returned list of plists contains information about the points where the tangents of this curve and the vector given as the argument are equal.

arguments:
vector GDL Vector

total-length number

The total length of the curve from given start-parameter to given end-parameter.

keyword arguments:
u1 Number, Default Value: (the u1)
The start parameter for computing the length
u2 Number, Default Value: (the u2)
The end parameter for computing the length
tolerance Number, Default Value: 0.01
The tolerance (absolute or relative to curve extent) for computing the length
tolerance-type Keyword Symbol, :relative or :absolute, Default Value: :relative
The type of the specified tolerance

trim gdl curve object

Returns a curve which is trimmed from parameter-1 to parameter-2.

arguments:
parameter-1 Number
The start parameter
parameter-2 Number
The end parameter

Examples

 
 (in-package :surf)

 (define-object test-curve (curve)
  
  :input-slots
  ((built-from (the curv-in)))
  
  :computed-slots
   ((control-pts (list (make-point 3 5 1)
                       (make-point 5 8.0 1) 
                       (make-point 7 10.0 1) 
                       (make-point 8 5.0 1) 
                       (make-point 7 0.0 1) 
                       (make-point 5 0.0 1) 
                       (make-point 3 5 1))))
   
   :hidden-objects
    ((curv-in  :type 'b-spline-curve
              :control-points (the control-pts))))

  (generate-sample-drawing :object-roots (make-object 'test-curve)
                         :projection-direction :top)
  

Package Documentation