Commit 96bd9fb0 authored by Dave Cooper's avatar Dave Cooper

updated defgeneric for lispworks

parent ed4ed212
......@@ -25,10 +25,14 @@
(define-object 3d-curve (b-spline-curve)
:documentation (:description "Given a uv on-surface curve and its surface, produce the corresponding 3d curve.")
:documentation (:description "Given a uv on-surface curve and its
surface, produce the corresponding 3d curve. Note this must be a true
on-surface curve, not just an arbitrary curve whose domain happens to
be in the parameter space of the surface.")
:input-slots ("GDL Curve object. Curve whose points are understood to be 2D u, v parameter values on the surface."
uv-curve
:input-slots ("GDL Curve object. Curve which is a proper on-surface
curve (e.g. produced by a project or drop operation
onto the surface)." uv-curve
"GDL Surface object. The surface corresponding to the given uv-curve."
surface)
......@@ -39,3 +43,38 @@
(control-points (mapcar #'(lambda(point)
(the surface (point (get-x point) (get-y point))))
(the uv-curve control-points)))))
(define-object 3d-approximated (approximated-curve)
:documentation (:description "Given a curve in uv parameter space of
a surface, produce a corresponding 3d curve with brute-force fitting
techniques.")
:input-slots
("GDL Curve object. Curve whose points are understood to be 2D u, v
parameter values on the surface."
uv-curve
"GDL Surface object. The surface corresponding to the given uv-curve."
surface
("Integer. How many point samples to take for fitting
purposes. Default is 42."
number-of-samples 42)
("Number. The tolerance for the final approximation, to be
multiplied by the 3d curve length. Default is 10e-5."
tolerance-factor 10e-5))
:hidden-objects
((3d-curve :type 'fitted-curve
:points (mapcar #'(lambda(point)
(the surface (point (get-x point) (get-y point))))
(the uv-curve (equi-spaced-points (the number-of-samples))))))
:computed-slots
((tolerance (* (the tolerance-factor) (the 3d-curve total-length)))
(curve-in (the 3d-curve))))
\ No newline at end of file
......@@ -281,8 +281,11 @@
(declare (ignore file-name curves surfaces breps file-type quiet?))
(error "Don't know how to write native file using ~s.~%" geometry-kernel))
(defmethod read-native-file ((geometry-kernel vanilla-geometry-kernel) file-name &key curves surfaces trees breps file-type quiet?)
(declare (ignore file-name curves surfaces trees breps file-type quiet?))
(defgeneric read-native-file (geometry-kernel file-name &key file-type quiet? sew-and-shrink-breps?))
(defmethod read-native-file ((geometry-kernel vanilla-geometry-kernel) file-name &key file-type quiet? sew-and-shrink-breps?)
(declare (ignore file-name sew-and-shrink-breps? file-type quiet?))
(error "Don't know how to read native file using ~s.~%" geometry-kernel))
......@@ -776,4 +779,4 @@
tolerance))
(define-vanilla-wrapper make-cardinal-spline (&key control-points tension-params periodic?))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment