Commit ca162782 authored by Dave Cooper's avatar Dave Cooper

working cardinal-spline

parent d1ba7dff
S 1
1H,,1H;,27H/Users/dcooper8/tmp/g282474,27H/Users/dcooper8/tmp/g282474, G 1
23HHarmonyWare Translators,23HHarmonyWare IGES v2.0.2,32,38,6,308,15,, G 2
1.,1,2HIN,1,1.,15H20160809.162959,1.D-6,21.3205116838006,,,11,0,15H20160G 3
809.162959; G 4
1H,,1H;,27H/Users/dcooper8/tmp/g168806,27H/Users/dcooper8/tmp/g168806, G 1
23HHarmonyWare Translators,23HHarmonyWare IGES v2.0.4,32,38,6,308,15,, G 2
1.,1,2HIN,1,1.,15H20160826.170217,1.D-6,21.3205116838006,,,11,0,15H20160G 3
826.170217; G 4
502 1 0 0 0 0 0 000010000D 1
502 0 0 16 1 0D 2
124 17 0 0 0 0 0 000000000D 3
......
S 1
1H,,1H;,27H/Users/dcooper8/tmp/g282464,27H/Users/dcooper8/tmp/g282464, G 1
23HHarmonyWare Translators,23HHarmonyWare IGES v2.0.2,32,38,6,308,15,, G 2
1.,1,2HIN,1,1.,15H20160809.162956,1.D-6,20.7712135760006,,,11,0,15H20160G 3
809.162956; G 4
1H,,1H;,27H/Users/dcooper8/tmp/g168796,27H/Users/dcooper8/tmp/g168796, G 1
23HHarmonyWare Translators,23HHarmonyWare IGES v2.0.4,32,38,6,308,15,, G 2
1.,1,2HIN,1,1.,15H20160826.170214,1.D-6,20.7712135760006,,,11,0,15H20160G 3
826.170214; G 4
502 1 0 0 0 0 0 000010000D 1
502 0 0 442 1 0D 2
110 443 0 0 0 0 0 000010000D 3
ISO-10303-21;
HEADER;
FILE_DESCRIPTION ((), '1');
FILE_NAME ('/Users/dcooper8/tmp/g282653', '2016-08-09T16:30:07', ('Unknown'), ('Unknown'), 'HarmonyWare STEP v2.0.2', 'HarmonyWare Translators', '');
FILE_NAME ('/Users/dcooper8/tmp/g168985', '2016-08-26T17:02:26', ('Unknown'), ('Unknown'), 'HarmonyWare STEP v2.0.4', 'HarmonyWare Translators', '');
FILE_SCHEMA (('CONFIG_CONTROL_DESIGN'));
ENDSEC;
......@@ -26462,9 +26462,9 @@ DATA;
#264330 = PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE ('', '', #264260, .NOT_KNOWN.);
#264340 = APPROVAL_STATUS ('approved');
#264350 = APPROVAL (#264340, '');
#264360 = CALENDAR_DATE (2016, 9, 8);
#264360 = CALENDAR_DATE (2016, 26, 8);
#264370 = COORDINATED_UNIVERSAL_TIME_OFFSET (0, $, .AHEAD.);
#264380 = LOCAL_TIME (16, 30, 7., #264370);
#264380 = LOCAL_TIME (17, 2, 26., #264370);
#264390 = DATE_AND_TIME (#264360, #264380);
#264400 = APPROVAL_DATE_TIME (#264390, #264350);
#264410 = APPROVAL_ROLE ('');
......@@ -26487,9 +26487,9 @@ DATA;
#264580 = SECURITY_CLASSIFICATION ('', '', #264570);
#264590 = APPROVAL_STATUS ('approved');
#264600 = APPROVAL (#264590, '');
#264610 = CALENDAR_DATE (2016, 9, 8);
#264610 = CALENDAR_DATE (2016, 26, 8);
#264620 = COORDINATED_UNIVERSAL_TIME_OFFSET (0, $, .AHEAD.);
#264630 = LOCAL_TIME (16, 30, 7., #264620);
#264630 = LOCAL_TIME (17, 2, 26., #264620);
#264640 = DATE_AND_TIME (#264610, #264630);
#264650 = APPROVAL_DATE_TIME (#264640, #264600);
#264660 = APPROVAL_ROLE ('');
......@@ -26499,9 +26499,9 @@ DATA;
#264700 = APPROVAL_PERSON_ORGANIZATION (#264690, #264600, #264660);
#264710 = CC_DESIGN_APPROVAL (#264600, (#264580));
#264720 = DATE_TIME_ROLE ('classification_date');
#264730 = CALENDAR_DATE (2016, 9, 8);
#264730 = CALENDAR_DATE (2016, 26, 8);
#264740 = COORDINATED_UNIVERSAL_TIME_OFFSET (0, $, .AHEAD.);
#264750 = LOCAL_TIME (16, 30, 7., #264740);
#264750 = LOCAL_TIME (17, 2, 26., #264740);
#264760 = DATE_AND_TIME (#264730, #264750);
#264770 = CC_DESIGN_DATE_AND_TIME_ASSIGNMENT (#264760, #264720, (#264580));
#264780 = PERSON_AND_ORGANIZATION_ROLE ('classification_officer');
......@@ -26514,9 +26514,9 @@ DATA;
#264850 = PRODUCT_DEFINITION ('', '', #264330, #264840);
#264860 = APPROVAL_STATUS ('approved');
#264870 = APPROVAL (#264860, '');
#264880 = CALENDAR_DATE (2016, 9, 8);
#264880 = CALENDAR_DATE (2016, 26, 8);
#264890 = COORDINATED_UNIVERSAL_TIME_OFFSET (0, $, .AHEAD.);
#264900 = LOCAL_TIME (16, 30, 7., #264890);
#264900 = LOCAL_TIME (17, 2, 26., #264890);
#264910 = DATE_AND_TIME (#264880, #264900);
#264920 = APPROVAL_DATE_TIME (#264910, #264870);
#264930 = APPROVAL_ROLE ('');
......@@ -26526,9 +26526,9 @@ DATA;
#264970 = APPROVAL_PERSON_ORGANIZATION (#264960, #264870, #264930);
#264980 = CC_DESIGN_APPROVAL (#264870, (#264850));
#264990 = DATE_TIME_ROLE ('creation_date');
#265000 = CALENDAR_DATE (2016, 9, 8);
#265000 = CALENDAR_DATE (2016, 26, 8);
#265010 = COORDINATED_UNIVERSAL_TIME_OFFSET (0, $, .AHEAD.);
#265020 = LOCAL_TIME (16, 30, 7., #265010);
#265020 = LOCAL_TIME (17, 2, 26., #265010);
#265030 = DATE_AND_TIME (#265000, #265020);
#265040 = CC_DESIGN_DATE_AND_TIME_ASSIGNMENT (#265030, #264990, (#264850));
#265050 = PERSON_AND_ORGANIZATION_ROLE ('creator');
......@@ -24,13 +24,28 @@
(define-object surface-knot-reduction-test (base-object)
:input-slots
((control-points (list (make-point 0 0 0)
(
#+nil
(control-points (list (make-point 0 0.01 0)
(make-point 2 3.0 0.0)
(make-point 4 2.0 0.0)
(make-point 5 0.0 0.0)
(make-point 4 -2.0 0.0)
(make-point 2 -3.0 0.0)
(make-point 0 0 0))))
(make-point 0 -0.01 0)
(make-point 0 0.01 0)
))
(control-points (list (make-point 0 0 0)
(make-point 2 3.0 0.0)
(make-point 4 2.0 0.0)
(make-point 5 0.0 0.0)
(make-point 4 -2.0 0.0)
(make-point 2 -3.0 0.0)
(make-point 0 0 0)
))
)
:computed-slots
......@@ -69,10 +84,13 @@
:scale-y 2.2)
(lofted-surface-test-simple :type 'lofted-surface
:display-controls (list :color :red-violet :isos (list :n-v 19 :n-u 19))
:tolerance 0.01
:curves (list (the curve-1) (the curve-3)
(the curve-4) (the curve-2)))
;;:display-controls (list :color :red-violet :isos (list :n-v 19 :n-u 19))
;;:tolerance 1.0
:curves (list (the curve-2)
(the curve-4)
(the curve-3)
(the curve-1)
))
(S-knot-reduction :type 'surface-knot-reduction
:surface (the lofted-surface-test-simple))))
......
......@@ -32,17 +32,13 @@ default to 0.0)."
:input-slots (through-points
(tension-params nil)
(periodic? nil)
("Keyword symbol. <tt>uniform</tt> gives alpha 0, <tt>centripetal</tt> gives alpha 0.5,
<tt>:chordal</tt> gives alpha 1. Default is nil, which lets alpha defer to its default, which is 0 (uniform)."
parameterization nil)
("Alpha value to control parameterization.
See <tt>parameterization</tt> input-slot for keyword equivalents.
Default is 0" alpha (if (the parameterization)
(ecase (the parameterization)
(:uniform 0)(:centripetal 0.5)(:chordal 1)) 0)))
("Boolean. Indicates whether the curve should close back to its start point. Default is <tt>nil</tt>."
periodic? nil)
("Keyword symbol. <tt>uniform</tt>, <tt>:chordal</tt> (or <tt>:chord-length</tt>), or <tt>centripetal</tt>.
Default is <tt>:uniform</tt>."
parameterization :uniform))
:computed-slots ((native-curve-iw (make-cardinal-spline *geometry-kernel*
:periodic? (the periodic?)
:tension-params (the tension-params)
......@@ -52,108 +48,83 @@ Default is 0" alpha (if (the parameterization)
(lastcar (the through-points))))
(butlast (the through-points))
(the through-points))
:alpha (the alpha)))))
:parameterization (the parameterization)))))
(define-object display-pts ()
:objects
((through :type (if (typep self 'cardinal-spline) 'points-display 'null-object)
:points (when (typep self 'cardinal-spline) (the through-points))
:display-controls (list :color :green))
(control :type 'points-display
:points (the control-points)
:display-controls (list :color :red))))
(define-object cardinal-spline* (cardinal-spline display-pts))
(define-object test-cr (base-object)
:objects
((uniform :type 'test-uniform-cr)
(centripetal :type 'test-centripetal-cr)
(chordal :type 'test-chordal-cr)))
(define-object test-uniform-cr (cardinal-spline*)
(define-object test-uniform-cr (cardinal-spline)
:computed-slots
((through-points (list (make-point 0 0 0)
(
(through-points (list (make-point 0 0 0)
(make-point 1 1 0)
(make-point 1.1 1 0)
(make-point 2 0 0)))
#+nil
(through-points
'(#(0.0 -91.0 0.0) #(96.0 -82.0 0.0) #(100.0 -68.5 0.0)
#(96.0 -54.99999999999999 0.0) #(0.0 -46.0 0.0)
#(-96.0 -54.99999999999999 0.0) #(-100.0 -68.5 0.0) #(-96.0 -82.0 0.0)))
(periodic? t)))
(define-object test-centripetal-cr (cardinal-spline*)
(define-object test-centripetal-cr (cardinal-spline)
:computed-slots
((alpha 0.5)
((parameterization :centripetal)
#+nil
(through-points (list (make-point 0 0 0)
(make-point 1 0 0)
(make-point 1 1 0)
(make-point 0 1 0)))
#+nil
(through-points (list (make-point 0 0 0)
(make-point 1 1 0)
(make-point 1.1 1 0)
(make-point 2 0 0)))
(through-points (list (make-point 0 0 0)
(make-point 0.9 1 0)
(make-point 1.1 1 0)
(make-point 2 0 0)))
#+nil
(through-points
'(#(0.0 -91.0 0.0) #(96.0 -82.0 0.0) #(100.0 -68.5 0.0)
#(96.0 -54.99999999999999 0.0) #(0.0 -46.0 0.0)
#(-96.0 -54.99999999999999 0.0) #(-100.0 -68.5 0.0) #(-96.0 -82.0 0.0)))
(periodic? t)))
(define-object test-chordal-cr (cardinal-spline*)
(define-object test-chordal-cr (cardinal-spline)
:computed-slots
((alpha 1)
((parameterization :chordal)
(through-points (list (make-point 0 0 0)
(make-point 1 1 0)
(make-point 1.1 1 0)
(make-point 2 0 0)))
(periodic? t)))
(define-object tom (base-object)
:objects
((uniform :type 'tom-cr :parameterization :uniform)
(centripetal :type 'tom-cr :parameterization :centripetal)
(chordal :type 'tom-cr :parameterization :chordal)
(alpha :type 'tom-cr :alpha 0.9)
#+nil
(through-points
'(#(0.0 -91.0 0.0) #(96.0 -82.0 0.0) #(100.0 -68.5 0.0)
#(96.0 -54.99999999999999 0.0) #(0.0 -46.0 0.0)
#(-96.0 -54.99999999999999 0.0) #(-100.0 -68.5 0.0) #(-96.0 -82.0 0.0)))
(frank :type 'b-spline-curve*
:control-points (the uniform control-points)
:knot-vector (the centripetal knot-vector)
#+nil
(normalize :knot-vector (the centripetal knot-vector)
:u-min (the uniform u-min)
:u-max (the uniform u-max)))
(stein :type 'b-spline-curve*
:control-points (the centripetal control-points)
:knot-vector (the uniform knot-vector))
(frank-chordal :type 'b-spline-curve*
:control-points (the uniform control-points)
:knot-vector (the chordal knot-vector))
))
(define-object b-spline-curve* (b-spline-curve display-pts))
(define-object tom-cr (cardinal-spline*)
:computed-slots
((periodic? t)
(through-points
#+nil
(list (make-point 0 0 0) (make-point 1 1 0)
(make-point 1.1 1 0) (make-point 2 0 0))
'(#(0.0 -91.0 6.5) #(96.0 -82.0 6.5) #(100.0 -68.5 6.5)
#(96.0 -54.99999999999999 6.5) #(0.0 -46.0 6.5)
#(-96.0 -54.99999999999999 6.5) #(-100.0 -68.5 6.5) #(-96.0 -82.0 6.5)))))
(periodic? t)))
#+nil
(define-object test-b-spline-curves (base-object)
:input-slots
......@@ -194,10 +165,73 @@ Default is 0" alpha (if (the parameterization)
:display-controls (list :color :green))))
#+nil
(defun normalize (&key knot-vector u-min u-max)
(let* ((new-delta (- (apply #'max knot-vector) (apply #'min knot-vector)))
(old-delta (- u-max u-min))
(step-ratio (div old-delta new-delta)))
(mapcar #'(lambda(knot) (* knot step-ratio)) knot-vector)))
#+nil
(define-object display-pts ()
:objects
((through :type (if (typep self 'cardinal-spline) 'points-display 'null-object)
:points (when (typep self 'cardinal-spline) (the through-points))
:display-controls (list :color :green))
(control :type 'points-display
:points (the control-points)
:display-controls (list :color :red))))
#+nil
(define-object cardinal-spline* (cardinal-spline display-pts))
#+nil
(define-object b-spline-curve* (b-spline-curve display-pts))
#+nil
(define-object tom-cr (cardinal-spline*)
:computed-slots
((periodic? t)
(through-points
#+nil
(list (make-point 0 0 0) (make-point 1 1 0)
(make-point 1.1 1 0) (make-point 2 0 0))
'(#(0.0 -91.0 6.5) #(96.0 -82.0 6.5) #(100.0 -68.5 6.5)
#(96.0 -54.99999999999999 6.5) #(0.0 -46.0 6.5)
#(-96.0 -54.99999999999999 6.5) #(-100.0 -68.5 6.5) #(-96.0 -82.0 6.5)))))
#+nil
(define-object tom (base-object)
:objects
((uniform :type 'tom-cr :parameterization :uniform)
(centripetal :type 'tom-cr :parameterization :centripetal)
(chordal :type 'tom-cr :parameterization :chordal)
(alpha :type 'tom-cr :alpha 0.9)
(frank :type 'b-spline-curve*
:control-points (the uniform control-points)
:knot-vector (the centripetal knot-vector)
#+nil
(normalize :knot-vector (the centripetal knot-vector)
:u-min (the uniform u-min)
:u-max (the uniform u-max)))
(stein :type 'b-spline-curve*
:control-points (the centripetal control-points)
:knot-vector (the uniform knot-vector))
(frank-chordal :type 'b-spline-curve*
:control-points (the uniform control-points)
:knot-vector (the chordal knot-vector))
))
......@@ -165,6 +165,7 @@ the SMLib make-skinned-surface routine. Default is nil"
(when (and control-points-1 control-points-2
(/= control-points-1 control-points-2))
(error "For lofted-surface, rail-1 and rail-2, if both specified, must be synchronized."))
(loft-surface* *geometry-kernel* (the curves)
:synchronized? (the synchronized?)
:rail-1 (when (the rail-1)
......
......@@ -779,7 +779,7 @@
right-or-left
tolerance))
(define-vanilla-wrapper make-cardinal-spline (&key control-points tension-params periodic? alpha))
(define-vanilla-wrapper make-cardinal-spline (&key control-points tension-params periodic? parameterization))
(define-vanilla-wrapper make-degenerate-curve (&key degree point))
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