id
int64 0
45.1k
| file_name
stringlengths 4
68
| file_path
stringlengths 14
193
| content
stringlengths 32
9.62M
| size
int64 32
9.62M
| language
stringclasses 1
value | extension
stringclasses 6
values | total_lines
int64 1
136k
| avg_line_length
float64 3
903k
| max_line_length
int64 3
4.51M
| alphanum_fraction
float64 0
1
| repo_name
stringclasses 779
values | repo_stars
int64 0
882
| repo_forks
int64 0
108
| repo_open_issues
int64 0
90
| repo_license
stringclasses 8
values | repo_extraction_date
stringclasses 146
values | sha
stringlengths 64
64
| __index_level_0__
int64 0
45.1k
| exdup_ids_cmlisp_stkv2
sequencelengths 1
47
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35,670 | revolved-surface.lisp | lisp-mirror_gendl/regression/source/revolved-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object revolved-surface-test (revolved-surface)
:computed-slots
((regression-test-data (multiple-value-list (the b-spline-data))))
:hidden-objects ((curve :type 'arc-curve
:center (translate (the center) :right 50)
:orientation (alignment :top (the (face-normal-vector :rear)))
:start-angle (half pi)
:end-angle (* 3/2 pi)
:radius 10)))
(register-test-definition 'revolved-surface-test)
| 1,363 | Common Lisp | .lisp | 31 | 40.193548 | 71 | 0.724848 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 12a8db02d307ca39206d3ccc120417756d28494e46943002b19749d47e0282e8 | 35,670 | [
-1
] |
35,671 | box-solid.lisp | lisp-mirror_gendl/regression/source/box-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object box-solid-test (box-solid)
:computed-slots
((length 10 :settable)
(width 20)
(height 30)
(my-volume (progn (format t "hey now...~%~%") (the volume)))
(regression-test-data (append
(multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%)
))))
(register-test-definition 'box-solid-test)
| 1,333 | Common Lisp | .lisp | 33 | 35.878788 | 71 | 0.710652 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | d58af834489c706524e4d6bb09cb6b382764b1382b90eedeac465fc15b346882 | 35,671 | [
-1
] |
35,672 | planar-contour-surface.lisp | lisp-mirror_gendl/regression/source/planar-contour-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object planar-contour-surface-test (planar-contour-surface)
:computed-slots
((regression-test-data (multiple-value-list (the b-spline-data))))
:hidden-objects
((island-curve :type 'b-spline-curve
:control-points (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)))))
(register-test-definition 'planar-contour-surface-test)
| 1,447 | Common Lisp | .lisp | 34 | 37.588235 | 71 | 0.693848 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 1d2765621e36a2b5646c1bb7a40e55093e1897864a6657c49d6ca040eccf8538 | 35,672 | [
-1
] |
35,673 | rectangular-surface.lisp | lisp-mirror_gendl/regression/source/rectangular-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object rectangular-surface-test (rectangular-surface)
:computed-slots
((length 20)
(width 30)
(height 0)
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'rectangular-surface-test)
| 1,180 | Common Lisp | .lisp | 28 | 38.821429 | 71 | 0.739207 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | ade754a28dd2203dcbd8f0bec381b46b5ae54a1cf97b80be2a2c01cc63258c3e | 35,673 | [
-1
] |
35,674 | general-sweep.lisp | lisp-mirror_gendl/regression/source/general-sweep.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
#+nil
(define-object general-sweep-test (surf::general-sweep)
:computed-slots
((profile-curve (the test-data-set (input-entities 1)))
(guide-curve (the test-data-set (input-entities 0)))
(v1-function #'(lambda(param)
(the guide-curve (tangent param))))
(v2-function #'(lambda(param)
(cross-vectors
(the (face-normal-vector :right))
(the guide-curve (tangent param)))))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((test-data-set :type 'surf::nurbs-reader
:file-name (merge-pathnames "fuselage_fuselage-part_0_section-structure_frames_element_0.dat"
gdl-lift-utils::*lift-data-directory*))))
#+nil
(register-test-definition 'general-sweep-test)
#+nil
(defvar *data* (merge-pathnames "../data/" #-lispworks *source-pathname* #+lispworks *load-truename*))
#+nil
(define-object test-guide-normal-on-surface-sweep ()
:input-slots
((input-dump-file1 "fuselage_fuselage-part_0_section-structure_frames_element_0.dat")
(input-dump-file2 "fuselage_fuselage-part_0_section-structure_frames_element_1.dat")
(input-dump-file3 "fuselage_fuselage-part_0_section-structure_frames_element_21.dat")
)
:computed-slots
((input-path1 (merge-pathnames (the input-dump-file1) *data*))
(input-path2 (merge-pathnames (the input-dump-file2) *data*))
(input-path3 (merge-pathnames (the input-dump-file3) *data*))
)
:objects
((expected-surf-data1 :type 'surf::nurbs-reader
:file-name (the input-path1))
#+nil
(expected-surf-data2 :type 'surf::nurbs-reader
:file-name (the input-path2))
#+nil
(expected-surf-data3 :type 'surf::nurbs-reader
:file-name (the input-path3))
#+nil
(example-class-use
:type 'guide-normal-on-surface-sweep
:sequence (:size (the :no-of-sweeps))
:guide-curve (nth (the-child :index) (the :guide-curves-to-use))
:profile (nth (the-child :index) (the :profiles))
:surface (the :surface)
:display-controls (case (nth (the-child :index) (the :display-options))
('a (merge-display-controls '(:color :yellow)))
('b (merge-display-controls '(:color :green)))
('c (merge-display-controls '(:color :blue)))
(otherwise (merge-display-controls '(:color :orange)))))
))
(define-object filleted-triangle-curve (non-rational-curve)
:computed-slots
((curve-in (the triangle)))
:objects
((triangle :type 'global-filleted-polyline-curve
:vertex-list (list (make-point 0 0 0)
(make-point -10 -5 0)
(make-point -10 0 0)
(make-point 0 0 0))
:default-radius 0.5)))
(define-object screw-spine (spiral-curve)
:computed-slots
((height 110)
(radius-1 20)
(radius-2 20)
(number-of-turns 8)))
(define-object screw-sweep (normal-sweep)
:computed-slots
((display-controls (list :color :blue))
(guide-curve (the screw-curve))
(profile-curve (the triangle-curve))
(end-caps-on-brep? t)
;;(screw-curve (the screw-curve-input (curves 0)))
)
:objects
((screw-curve :type 'screw-spine)
#+nil
(screw-curve-input :type 'native-reader
:file-name "/tmp/screw-curve.iwp")
(triangle-curve :type 'filleted-triangle-curve)))
(define-object screw (subtracted-solid)
:computed-slots
((error-on-invalid? nil)
(brep (the cylinder))
(other-brep (the cut-sweep brep))
(display-controls (list :color :blue))
)
:objects
((cut-sweep :type 'screw-sweep)
(cylinder :type 'cylinder-solid
:display-controls (list :color :red)
:length 110
:radius 17.5
:orientation (alignment :rear (the (face-normal-vector :top)))
:center (translate (the center) :up (half (the-child length))))
)) | 5,083 | Common Lisp | .lisp | 121 | 33.991736 | 112 | 0.641788 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 2582c68203880543443f4cdc3aa911d889a02cf9b01d70d1ad3366e244905b97 | 35,674 | [
-1
] |
35,675 | planar-offset-curve.lisp | lisp-mirror_gendl/regression/source/planar-offset-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object planar-offset-curve-test (planar-offset-curve)
:computed-slots
((curve-in (the curve))
(plane-normal (make-vector 0 0 -1))
(distance 1)
(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)))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((curve :type 'b-spline-curve
:control-points (the points)
:degree 4)))
(register-test-definition 'planar-offset-curve-test)
| 1,533 | Common Lisp | .lisp | 39 | 35 | 71 | 0.697817 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 3e452edb98f76a1126d130359b43ad636e1bf03b9e26b66ab107b42db3704740 | 35,675 | [
-1
] |
35,676 | b-spline-curve.lisp | lisp-mirror_gendl/regression/source/b-spline-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object b-spline-curve-test (b-spline-curve)
:input-slots
((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)))
(regression-test-data (list (multiple-value-list (the b-spline-data))
(the %curves-to-draw%)))
;;(regression-test-data (multiple-value-list (the total-length)))
;;(regression-test-data (multiple-value-list (the b-spline-data-list)))
;;(regression-test-data (smlib::get-curve-b-spline-data *geometry-kernel* (the native-curve)))
))
(register-test-definition 'b-spline-curve-test)
(define-object b-spline-curve-test-2 (base-object)
:input-slots
((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 ((child-orientation (alignment :rear (rotate-vector-d (the (face-normal-vector :rear))
45
(the (face-normal-vector :right))))))
:objects
((global-curve :type 'b-spline-curve
:degree 1
:control-points (the control-points)
:orientation (the child-orientation))
(local-curve :type 'b-spline-curve
:degree 1
:local? t
:control-points (the control-points)
:orientation (the child-orientation))))
| 2,417 | Common Lisp | .lisp | 59 | 35.576271 | 105 | 0.679739 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | c98717b33219db7e68834d2cc522fc58614a3eb78e5090cc51b885d0022c04d3 | 35,676 | [
-1
] |
35,677 | compatible-surfaces.lisp | lisp-mirror_gendl/regression/source/compatible-surfaces.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object compatible-surfaces-test (compatible-surfaces)
:computed-slots
((surface-list (list (the surf-A) (the surf-B)))
(regression-test-data (append-elements (the surfaces) (multiple-value-list (the-element b-spline-data)))))
:objects
((surf-A :type 'rectangular-surface
:display-controls (list :color :green-spring-medium)
:length 10
:width 10)
(surf-B :type 'rectangular-surface
:display-controls (list :color :red)
:center (make-point 10 0 0 )
:length 10
:width 10)))
(register-test-definition 'compatible-surfaces-test)
| 1,525 | Common Lisp | .lisp | 36 | 38.277778 | 110 | 0.724162 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 27454907ac81977f897b0f9d984e4911cc7e7d07d47f9b0fdcba0008be968a6c | 35,677 | [
-1
] |
35,678 | silhouette-curves.lisp | lisp-mirror_gendl/regression/source/silhouette-curves.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object silhouette-curves-test (base-object)
:computed-slots ((section-tolerance 0.1)
(fit-tolerance 0.1))
:objects
((surface :type 'spherical-surface
:display-controls (list :isos (list :n-u 2 :n-v 2))
:radius 10)
(top-silhouette :type 'silhouette-curves
:surface (the surface)
:eye-point-or-vector (the surface (face-normal-vector :front)))))
(define-object sphere-silhouette-test (base-object)
:objects
((surface :type 'spherical-surface
:display-controls (list :isos (list :n-u 2 :n-v 2))
:radius 1000)
(top-silhouette :type 'silhouette-curves
:surface (the surface)
:eye-point-or-vector (the surface (face-normal-vector :top)))))
(define-object bspline-surface-silhouette-test (base-object)
:objects
((surface :type 'test-b-spline-surface
:display-controls (list :line-thickness 0.5 :isos (list :n-u 3 :n-v 3)))
(silhouette :type 'silhouette-curves
:surface (the surface)
:eye-point-or-vector (the (face-normal-vector :top)))))
| 2,062 | Common Lisp | .lisp | 46 | 38.608696 | 84 | 0.679577 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 58d0bc566e59ad88ca0b0c3f515a890d67476a7d2ec581bbc2f0d4b86a9ededb | 35,678 | [
-1
] |
35,679 | composed-curve.lisp | lisp-mirror_gendl/regression/source/composed-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object composed-curve-test (composed-curve)
:computed-slots
((curves (the filleted-polyline-curves ordered-curves))
(regression-test-data (multiple-value-list (the b-spline-data))))
:hidden-objects
((filleted-polyline-curves :type 'global-filleted-polyline-curves
:default-radius 5
:vertex-list (list (make-point 0 0 0)
(make-point 10 10 0)
(make-point 30 10 0)
(make-point 40 0 0)
(make-point 30 -10 0)
(make-point 10 -10 0)
(make-point 0 0 0)))))
(register-test-definition 'composed-curve-test)
| 1,511 | Common Lisp | .lisp | 36 | 37.527778 | 71 | 0.711142 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 13d3eb89861f7c1e0c450ada57c5ada23f3571a2c82c6df32c18e52e3b483fb7 | 35,679 | [
-1
] |
35,680 | sewn-solid.lisp | lisp-mirror_gendl/regression/source/sewn-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object sewn-solid-test (surf::sewn-solid)
:computed-slots
((surfaces (the box faces list-elements))
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((box :type 'box-solid
:width 10 :length 10 :height 10)))
(register-test-definition 'sewn-solid-test)
| 1,271 | Common Lisp | .lisp | 31 | 38.548387 | 79 | 0.741857 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | f466dd6a88332b89e53250d39b4c0244898220785f812f58e08e9f5c6536ae51 | 35,680 | [
-1
] |
35,681 | boolean.lisp | lisp-mirror_gendl/regression/source/boolean.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object boolean-test (intersected-solid)
:computed-slots
((brep (the cylinder))
(other-brep (the box))
(error-on-invalid? nil)
;;(approximation-tolerance 0.0001)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((cylinder :type 'cylinder-solid
:radius 10
:length 20)
(box :type 'box-solid
:length 10
:height 10
:width 30)))
(register-test-definition 'boolean-test)
| 1,484 | Common Lisp | .lisp | 39 | 33.333333 | 82 | 0.698034 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 74af33c1af00f2a6877447378430f2475f94566350a844eb69a413bd127191e4 | 35,681 | [
-1
] |
35,682 | planar-surface.lisp | lisp-mirror_gendl/regression/source/planar-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object planar-surface-test (planar-surface)
:computed-slots
((p00 (make-point 0 0 0))
(p01 (make-point 0 1 0))
(p10 (make-point 1 0 0))
(p11 (make-point 1.5 1.5 0))
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'planar-surface-test)
;;
;; Memory leak results: 1MB for 10000 iterations.
;;
| 1,299 | Common Lisp | .lisp | 32 | 37.3125 | 71 | 0.723917 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | e8ba78d3f1e51b5c966fa9d5ad987fde971022a64f45cc711ba50816e6c0427b | 35,682 | [
-1
] |
35,683 | fitted-curve.lisp | lisp-mirror_gendl/regression/source/fitted-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object fitted-curve-test (fitted-curve)
:computed-slots
((points (the circle (equi-spaced-points 20)))
(regression-test-data (multiple-value-list (the b-spline-data))))
:hidden-objects
((circle :type 'circle :radius 10)))
(define-object fitted-curve-test-2 (fitted-curve)
:computed-slots
(
(regression-test-data (multiple-value-list (the b-spline-data)))
(offset-plane-normal (the (face-normal-vector :rear)))
(offset-distance 50)
(sample-parameters (the (equi-spaced-parameters (length (the points)))))
(sample-points (mapcar #'(lambda(param)
(the (point param))) (the sample-parameters)))
(sample-tangents (mapcar #'(lambda(param)
(the (tangent param))) (the sample-parameters)))
(offset-points (mapcar #'(lambda(point tangent)
(translate-along-vector point
(cross-vectors (the offset-plane-normal)
tangent
)
(the offset-distance)))
(the sample-points)
(the sample-tangents)))
(interpolant? nil)
(points
(list #(-23.773313 1.924594 -12.071495) #(-22.841344380918503 1.759739783016406 -14.181323943024323)
#(-21.841344380918503 2.4122139947099095 -14.729992667370558)
#(-20.841344380918507 3.3536863929530267 -14.923734875318676)
#(-19.841344380918382 4.176489135579425 -15.06870580103053)
#(-18.8413443809184 4.933777500473312 -15.202185050851405)
#(-17.841344380918425 5.631369721976035 -15.325168730248224)
#(-16.84134438091845 6.273970454148179 -15.438491956009626)
#(-15.841344380918468 6.865530149027527 -15.542832621612929)
#(-14.841344380918478 7.4093395241001785 -15.638764660742744)
#(-13.841344380918416 7.90815438686246 -15.72678137237866)
#(-12.84134438091844 8.364367152996033 -15.807284787392605)
#(-11.841344380918452 8.77996681216584 -15.880637519214574)
#(-10.841344380918452 9.156701239361068 -15.94713447461761)
#(-9.841344380918448 9.496052643404102 -16.007034859594235)
#(-8.841344380918441 9.799271723250216 -16.060568901021437)
#(-7.841344380918437 10.06746531437129 -16.107919555112268)
#(-6.841344380918429 10.301560000602155 -16.149248415345042)
#(-5.841344380918427 10.502317266184134 -16.184700135961652)
#(-4.841344380918503 10.670411264401993 -16.214379697901453)
#(-3.8413443809185037 10.806360061789343 -16.23838592168945)
#(-2.8413443809185037 10.91058281577113 -16.256793898099733)
#(-1.841344380918504 10.98341556965735 -16.269652365713124)
#(-0.8413443809185032 11.025055813332797 -16.277008983500682)
#(0.15865561908149672 11.035644948815769 -16.278878956118103)
#(1.1586556190814967 11.015215162491632 -16.275267609672653)
#(2.1586556190814967 10.963686970735495 -16.266171675614164)
#(3.1586556190814967 10.88092426467907 -16.251556448859898)
#(4.158655619081497 10.766677044427743 -16.23137766334388)
#(5.158655619081498 10.62057414933642 -16.205582068129765)
#(6.158655619081422 10.442180676557317 -16.174081243108095)
#(7.158655619081425 10.230925408456665 -16.136776521368255)
#(8.158655619081431 9.98609937607083 -16.09355384390509)
#(9.158655619081435 9.706896947892174 -16.04426088401215)
#(10.158655619081443 9.392342681411849 -15.98872728569834)
#(11.158655619081445 9.041274709139891 -15.926760084999787)
#(12.158655619081443 8.652384488847156 -15.858115816863863)
#(13.158655619081426 8.224088375742841 -15.782532484457718)
#(14.158655619081479 7.754593734167767 -15.699684864521048)
#(15.158655619081467 7.241780261514546 -15.609202831094764)
#(16.158655619081458 6.683139763207802 -15.510659940970609)
#(17.15865561908144 6.0757727707709925 -15.4035344243332)
#(18.15865561908141 5.416172867974698 -15.287229141145774)
#(19.158655619081383 4.700197459553999 -15.161011513585837)
#(20.158655619081493 3.9228092499506992 -15.024003655356676)
#(21.158655619081504 2.8543291359267267 -14.907649406809197)
#(22.158655619081493 2.1945491375308506 -14.612153140548436)
#(23.158655619081493 1.3990454658479357 -13.81473853600493)
#(23.158655619081497 3.582334935707711 -10.01826248221973)
#(22.1586556190815 5.522048829120016 -7.611015079357786)
#(21.158655619081493 7.0164193259761785 -5.362185530249421)
#(20.158655619081365 8.186295010076309 -3.22911563667378)
#(19.158655619081497 9.101180043581415 -1.1872530565531378)
#(18.1586556190815 9.805345072581082 0.7790079766743399)
#(17.158655619081493 10.328869164179935 2.680255854374877)
#(16.1586556190815 10.69311633295447 4.52399447020087)
#(15.158655619081497 10.913663395166884 6.315732365008114)
#(14.158655619081499 11.000833212266512 8.060440470107608)
#(13.158655619081499 10.962715532275286 9.761699723427306)
#(12.158655619081495 10.806046718198589 11.421633325908237)
#(11.158655619081497 10.535640414347894 13.041755498169548)
#(10.158655619081497 10.154740933650833 14.623073252618243)
#(9.158655619081497 9.665224654008608 16.166157476531936)
#(8.158655619081497 9.067708489894999 17.67118070125608)
#(7.158655619081498 8.361632005149593 19.13789695167163)
#(6.158655619081496 7.545182671632559 20.565658128968195)
#(5.158655619081498 6.6151967040761805 21.95337139481127)
#(4.158655619081496 5.567000905705767 23.299412040811102)
#(3.1586556190814967 4.394063811437401 24.60154203551763)
#(2.1586556190814967 2.8004311295619044 25.952393206193605)
#(1.1586556190814967 1.7448809507641723 26.783832751360602)
#(0.1586556190814967 1.4072204669238992 26.97844965398033)
#(-0.8413443809185032 1.88320122929102 26.83937875640717)
#(-1.8413443809185033 2.6484030661557543 26.213462741853462)
#(-2.8413443809185033 3.9944419897158476 25.00508851939353)
#(-3.8413443809185037 5.208693300048525 23.717475631772473)
#(-4.841344380918503 6.295670402753672 22.385089223556385)
#(-5.841344380918503 7.262575712824631 21.01039818449651)
#(-6.841344380918502 8.114638840836841 19.595204406997734)
#(-7.841344380918503 8.855482099043869 18.14075745206532)
#(-8.841344380918503 9.487327344116311 16.647843748061646)
#(-9.841344380918501 10.011121551590394 15.116837084142482)
#(-10.841344380918505 10.42662999568028 13.547692459702091)
#(-11.841344380918503 10.732381125360016 11.939970034589686)
#(-12.841344380918505 10.92557571834092 10.292811263403342)
#(-13.841344380918503 11.00194351680579 8.604861209227394)
#(-14.841344380918505 10.955402384973151 6.8742080479809085)
#(-15.841344380918503 10.77804067000267 5.0979483240850385)
#(-16.841344380918507 10.460862535510797 3.2712297214141297)
#(-17.841344380918503 9.989881559101038 1.388927349335879)
#(-18.841344380918507 9.345800488074271 -0.5557314586957092)
#(-19.841344380918507 8.501745502438851 -2.5722043019827843)
#(-20.841344380918137 7.418783713681504 -4.67420987442744)
#(-21.841344380918503 6.037220810436056 -6.882831204671871)
#(-22.841344380918507 4.257093771052562 -9.233367166492508)
#(-23.773313 1.924594 -12.071495))))
:objects
((points-disp :type 'points-display
:points (the points))
(offset-points-disp :type 'points-display
:points (the offset-points))
(our-offset :type 'fitted-curve
:interpolant? nil
:degree 2
:points (the offset-points))
(compatibles :type 'compatible-curves
:curve-list (list self (the our-offset)))
(loft :type 'lofted-surface
:curves (list-elements (the compatibles curves)))
(offset :type 'planar-offset-curve
:curve-in self
:distance 50
:plane-normal (the (face-normal-vector :rear))
;;:closure :closed
;;:closed? t
;:check-continuity t
)))
(define-object fitted-curve-test-3 (fitted-curve)
:computed-slots
((regression-test-data (multiple-value-list (the b-spline-data)))
(points (the circle (equi-spaced-points 20))))
:hidden-objects
((spheres :type 'sphere
:sequence (:size (length (the points)))
:radius 0.2
:center (nth (the-child :index) (the points))
:display-controls (list :color :blue-neon))
(circle :type 'circle :radius 10)
(view :type 'base-view
:width (* 5 72) :height (* 5 72)
:objects (cons self (list-elements (the spheres))))))
(define-object fitted-curve-test-4 (fitted-curve)
:input-slots
((degree 1))
:computed-slots
((regression-test-data (multiple-value-list (the b-spline-data)))
(smooth-corners? nil)
;;(parameterization :chordlength)
(points (list (make-point -1 -2 0)
(make-point -1 2 0)
(make-point 1 2 0)
(make-point 1 -2 0)
(make-point -1 -2 0)))))
(dolist (symbol '(fitted-curve-test fitted-curve-test-2 fitted-curve-test-3 fitted-curve-test-4))
(register-test-definition symbol))
(define-object fitted-curve-test-local-global (base-object)
:computed-slots ((child-orientation (alignment :rear (rotate-vector-d (the (face-normal-vector :rear))
45
(the (face-normal-vector :right))))))
:objects
((local-degree-1 :type 'fitted-curve-test-4
:orientation (the child-orientation)
:local? t)
(local-degree-3 :type 'fitted-curve-test-4
:orientation (the child-orientation)
:local? t
:degree 3)
(global-degree-1 :type 'fitted-curve-test-4
:orientation (the child-orientation))
(global-degree-3 :type 'fitted-curve-test-4
:orientation (the child-orientation)
:degree 3)))
| 10,649 | Common Lisp | .lisp | 209 | 44.880383 | 105 | 0.737252 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 832e38c45f635be5e7f826af12f2210198762face302cc53ad2b6dca35e6152a | 35,683 | [
-1
] |
35,684 | spherical-surface.lisp | lisp-mirror_gendl/regression/source/spherical-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object spherical-surface-test (spherical-surface)
:computed-slots
((radius 10)
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'spherical-surface-test)
| 1,144 | Common Lisp | .lisp | 26 | 40.807692 | 71 | 0.745223 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | d2212452d4eddd726e06cd43f280386527f042e9b5c5559c5a49ffb43286e3d7 | 35,684 | [
-1
] |
35,685 | stitched-solid.lisp | lisp-mirror_gendl/regression/source/stitched-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object stitched-solid-test (stitched-solid)
:computed-slots
((length 20)
(width 10)
(height 10)
(faces-in (list (the top-face) (the bottom-face)
(the right-face) (the left-face)
(the rear-face) (the front-face)))
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:hidden-objects
((box :type 'box)
(top-face :type 'planar-surface
:p00 (the box (vertex :top :right :rear))
:p01 (the box (vertex :top :right :front))
:p10 (the box (vertex :top :left :rear))
:p11 (the box (vertex :top :left :front)))
(bottom-face :type 'planar-surface
:p00 (the box (vertex :bottom :right :rear))
:p01 (the box (vertex :bottom :right :front))
:p10 (the box (vertex :bottom :left :rear))
:p11 (the box (vertex :bottom :left :front)))
(right-face :type 'planar-surface
:p00 (the box (vertex :top :right :rear))
:p01 (the box (vertex :top :right :front))
:p10 (the box (vertex :bottom :right :rear))
:p11 (the box (vertex :bottom :right :front)))
(left-face :type 'planar-surface
:p00 (the box (vertex :top :left :rear))
:p01 (the box (vertex :top :left :front))
:p10 (the box (vertex :bottom :left :rear))
:p11 (the box (vertex :bottom :left :front)))
(rear-face :type 'planar-surface
:p00 (the box (vertex :top :right :rear))
:p01 (the box (vertex :top :left :rear))
:p10 (the box (vertex :bottom :right :rear))
:p11 (the box (vertex :bottom :left :rear)))
(front-face :type 'planar-surface
:p00 (the box (vertex :top :right :front))
:p01 (the box (vertex :top :left :front))
:p10 (the box (vertex :bottom :right :front))
:p11 (the box (vertex :bottom :left :front)))))
;(register-test-definition 'stitched-solid-test)
| 2,857 | Common Lisp | .lisp | 65 | 38.446154 | 80 | 0.664948 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 47dd4fe25de0aa57999b6a9e9c56d332767eb56e7c95aa444b0a055dffb6ab6c | 35,685 | [
-1
] |
35,686 | ruled-surface.lisp | lisp-mirror_gendl/regression/source/ruled-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object ruled-surface-test (ruled-surface)
:computed-slots
((regression-test-data (multiple-value-list (the b-spline-data))))
:hidden-objects
((curve-1 :type 'linear-curve
:start (make-point -1 -1 0)
:end (make-point -1 1 0))
(curve-2 :type 'fitted-curve
:points (list (make-point 1 -1 0) (make-point 0 0 0)
(make-point .5 .5 0) (make-point 1 2 0)))))
(register-test-definition 'ruled-surface-test)
| 1,381 | Common Lisp | .lisp | 32 | 39.25 | 71 | 0.712991 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9c1c3ad96ae8d70d86e39558cafb45f1d85c4d6f2e81e468695b715adc7e8c88 | 35,686 | [
-1
] |
35,687 | extended-surface.lisp | lisp-mirror_gendl/regression/source/extended-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object extended-surface-test (base-object)
:computed-slots
((regression-test-data (list (multiple-value-list (the extended b-spline-data))
(multiple-value-list (the extended-2 b-spline-data))
(multiple-value-list (the extended-3 b-spline-data))
(multiple-value-list (the extended-4 b-spline-data))))
(display-list-objects (list (the loft)
(the extended)
(the extended-2))))
:objects
((test3 :type 'linear-curve
:start (make-point 0 0 0)
:end (make-point 10 0 0))
(test4 :type 'linear-curve
:start (make-point 0 10 0)
:end (make-point 10 10 0))
(mid-1 :type 'linear-curve
:start (make-point 0 5.0 1)
:end (make-point 10 5.0 1))
(mid-2 :type 'linear-curve
:start (make-point 0 8.0 1)
:end (make-point 10 8.0 1))
(bridge-1 :type 'b-spline-curve
:control-points (list (make-point 0 0 0)
(make-point -2 5.0 3)
(make-point -2 8.0 3)
(make-point 0 10 0)))
(bridge-2 :type 'b-spline-curve
:control-points (list (make-point 10 0 0)
(make-point 12 5.0 5)
(make-point 12 8.0 5)
(make-point 10 10 0)))
(bridge-3 :type 'b-spline-curve
:control-points (list (make-point 0 -1 0)
(make-point 3 -1 5)
(make-point 7 -1 5)
(make-point 10 -1 0)))
(loft :type 'lofted-surface
:curves (list (the test3) (the mid-1)
(the mid-2) (the test4)))
(extended :type 'extended-surface
:display-controls (list :color :red :line-thickness 2)
:surface (the loft)
:curve (the bridge-1)
:direction :v
:which-end :start)
(extended-2 :type 'extended-surface
:display-controls (list :color :green :line-thickness 2)
:surface (the loft)
:curve (the bridge-1)
:direction :v
:which-end :start
:deformation-param (+ (* 0.25 (- (the-child surface v-max)
(the-child surface v-min)))
(the-child surface u-min)))
(extended-3 :type 'extended-surface
:display-controls (list :color :orange
:isos (list :n-u 25 :n-v 25))
:surface (the loft)
:curve (the bridge-3)
:direction :u
:continuity :cmax
:which-end :start)
(extended-4 :type 'extended-surface
:display-controls (list :color :blue
:isos (list :n-u 25 :n-v 25))
:surface (the loft)
:curve (the bridge-3)
:direction :u
:deformation-param (+ (* 0.25 (- (the-child surface u-max)
(the-child surface u-min)))
(the-child surface u-min))
:continuity :cmax
:which-end :start)))
(register-test-definition 'extended-surface-test)
| 4,529 | Common Lisp | .lisp | 96 | 31.447917 | 86 | 0.506505 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 412a933d7010a1ceca6c48349a8cc199eef5192e16040cf9e24738bfdc67daba | 35,687 | [
-1
] |
35,688 | brep-brep-solve.lisp | lisp-mirror_gendl/regression/source/brep-brep-solve.lisp | (in-package :gdl-lift-tests)
(define-object brep-brep-solve-test (base-object)
:computed-slots ((brep (the sphere brep))
(face-breps (mapcar #'(lambda(face)
(the-object face basis-surface brep))
(list-elements (the box faces)))))
:objects
((sphere :type 'spherical-surface
:radius 10
)
(box :type 'box-solid
:center (the sphere brep bounding-bbox center)
:length (the sphere brep bounding-bbox length)
:width (the sphere brep bounding-bbox width)
:height (the sphere brep bounding-bbox height))
(face-points :type 'point
:sequence (:size (length (the face-breps)))
:center (the sphere brep (brep-solve (nth (the-child index) (the face-breps)) :minimize))))
:functions
((test-solve
()
(dolist (brep (the face-breps))
(print-variables (the sphere brep (brep-solve brep :minimize)))))))
| 894 | Common Lisp | .lisp | 23 | 33.130435 | 93 | 0.687575 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 73ab5f5a909ccebccc5ad501042f6da7e54fdd18c3b1f1e6cc87bce97b32469c | 35,688 | [
-1
] |
35,689 | planar-section-curves.lisp | lisp-mirror_gendl/regression/source/planar-section-curves.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object planar-section-curves-test (planar-section-curves)
:computed-slots
((points-data '(((0 0 0)(4 1 0)(8 1 0)(10 0 0)(8 -1 0)(4 -1 0)(0 0 0))
((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2))
((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4))
((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7))))
(surface (the test-surf))
(plane-normal (the (face-normal-vector :front)))
(plane-point (make-point 0 0.5 0))
(regression-test-data (mapcar #'(lambda(curve)
(multiple-value-list (the-object curve b-spline-data)))
(the curves list-elements))))
:objects
((test-surf :type 'b-spline-surface
:control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data)))))
(register-test-definition 'planar-section-curves-test)
(define-object planar-section-curves-test-2 (base-object)
:input-slots ((span 0.5) (c-root-profile 0.3) (c-tip-profile 0.05)
(large-scale-factor 1000))
:computed-slots ((regression-test-data (list (the sectioned-skin-small regression-test-data)
(the sectioned-skin-small regression-test-data))))
:objects
((sectioned-skin-small :type 'sectioned-foil
:section-approximation-tolerance 1.0e-12
:display-controls (list :color :green)
:pass-down (span c-root-profile c-tip-profile))
(sectioned-skin-large :type 'sectioned-foil
:section-approximation-tolerance 1.0e-9
:scale-factor (the large-scale-factor)
:display-controls (list :color :green)
:span (* (the large-scale-factor) (the span))
:c-root-profile (* (the large-scale-factor) (the c-root-profile))
:c-tip-profile (* (the large-scale-factor) (the c-tip-profile)))))
(define-object sectioned-foil (lofted-surface-test-2)
:input-slots
((section-approximation-tolerance 1.0e-12 :settable)
(rib-approximation-tolerance 0.001 :settable)
(spar-positions (list 0.2 0.5 0.7 0.9 0.98))
(rib-positions '(0.0 0.33 0.66 1.0))
(scale-factor 1))
:computed-slots
((regression-test-data (mapcar #'(lambda(section-curves)
(mapcar #'(lambda(curve)
(multiple-value-list
(the-object curve b-spline-data)))
(list-elements
(the-object section-curves curves))))
(append (list-elements (the diagonal-curves))
(list-elements (the spar-curves))
(list-elements (the rib-curves))))))
:objects
((diagonal-curves :type 'planar-section-curves
:hidden? nil
:surface self
:3d-approximation-tolerance 1.0e-2
:display-controls (list :color :purple)
:sequence (:size (length (the spar-positions)))
:plane-point (translate (the (point 0 0 ))
:left (* (- 1 (nth (the-child index)
(the spar-positions)))
(the c-root-profile)))
:plane-normal (rotate-vector-d
(cross-vectors (subtract-vectors (the-child end)
(the-child start))
(the (face-normal-vector :top)))
-.001
(the (face-normal-vector :top)) )
:pseudo-inputs (start end)
:start (translate (the (point 0 0 ))
:left (* (- 1 (nth (the-child index)
(the spar-positions)))
(the c-root-profile)))
:end (translate (the (point 1 0 ))
:left (* (- 1 (nth (the-child index)
(the spar-positions)))
(the c-tip-profile))))
(spar-curves :type 'planar-section-curves
:hidden? nil
:surface self
:3d-approximation-tolerance (the section-approximation-tolerance)
:display-controls (list :color :red)
:sequence (:size (length (the spar-positions)))
:plane-point (translate (the (point 0 0 ))
:left (* (- 1 (nth (the-child index)
(the spar-positions)))
(the c-root-profile)))
:plane-normal (cross-vectors (subtract-vectors (the-child end)
(the-child start))
(the (face-normal-vector :top)))
:pseudo-inputs (start end)
:start (translate (the (point 0 0 ))
:left (* (- 1 (nth (the-child index)
(the spar-positions)))
(the c-root-profile)))
:end (translate (the (point 1 0 ))
:left (* (- 1 (nth (the-child index)
(the spar-positions)))
(the c-tip-profile))))
(rib-planar-contours :type 'planar-contour-surface
:display-controls (list :isos (list :n-u 8 :n-v 8))
:sequence (:size (the rib-curves number-of-elements))
:island-curve (the (rib-curves (the-child index)) (curves 0)))
(rib-shells :type 'shelled-solid
:sequence (:size (the rib-curves number-of-elements))
:display-controls (list :isos (list :n-u 8 :n-v 8))
:brep (the (rib-planar-contours (the-child index)))
:distance (* (the scale-factor) 0.001))
(rib-curves :type 'planar-section-curves
:hidden? nil
;;:3d-approximation-tolerance (* (the section-approximation-tolerance) 100)
:3d-approximation-tolerance (the rib-approximation-tolerance)
:display-controls (list :color :blue)
:surface self
:sequence (:size (length (the rib-positions)))
:plane-point (translate (the (point 0 0 ))
:rear (* (- 1 (nth (the-child index)
(the rib-positions)))
(the span)))
:plane-normal (the (face-normal-vector :rear)))))
#+nil
(register-test-definition 'planar-section-curves-test-2)
| 6,276 | Common Lisp | .lisp | 142 | 38.014085 | 102 | 0.644704 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 7ad9345691a8b8ba4c17547defbbb41ba0b758564994b8bb6376bfbef0238700 | 35,689 | [
-1
] |
35,690 | fitted-conic.lisp | lisp-mirror_gendl/regression/source/fitted-conic.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object fitted-conic-test (fitted-conic)
:computed-slots
((points (let ((points (the circle (equi-spaced-points 20))))
(cons (lastcar points)
(rest points)))))
:hidden-objects
((circle :type 'circle :radius 10)))
(define-object fitted-conic-test-2 (fitted-conic)
:computed-slots
((smooth-corners? nil)
(tangency :bessel)
;;(parameterization :chordlength)
(points (list (make-point -1 -2 0)
(make-point -1 2 0)
(make-point 1 2 0)
(make-point 1 -2 0)
(make-point -1 -2 0)))))
| 1,437 | Common Lisp | .lisp | 38 | 34.868421 | 70 | 0.720492 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 861f68301b6787f2a2eba1974d5b2ac0987e5a072071695152cac0fdcf2f3b28 | 35,690 | [
-1
] |
35,691 | blended-solid.lisp | lisp-mirror_gendl/regression/source/blended-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object blended-solid-test (blended-solid)
:computed-slots
((display-controls (list :color :blue))
(default-radius 3)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((brep :type 'surf::box-solid
:length 10 :width 20 :height 15)))
(register-test-definition 'blended-solid-test)
| 1,304 | Common Lisp | .lisp | 32 | 38.15625 | 79 | 0.745004 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 90c1ca5657d9281adf58c9b3407c25f620b9259480c97b4e9a963fab1b6be963 | 35,691 | [
-1
] |
35,692 | fitted-surface.lisp | lisp-mirror_gendl/regression/source/fitted-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object fitted-surface-test (fitted-surface)
:input-slots
((grid-width 4 :settable)
(grid-length 4 :settable)
(grid-height 4 :settable))
:computed-slots
((points (list (list (make-point 0 0 0)
(make-point (/ (the grid-width) 4) 0 0)
(make-point (half (the grid-width)) 0 0)
(make-point (* 3/4 (the grid-width)) 0 0)
(make-point (the grid-width) 0 0))
(list (make-point 0 (/ (the grid-length) 4) 0)
(make-point (/ (the grid-width) 4) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (half (the grid-width)) (/ (the grid-length) 4)
(* (/ (the grid-height) 4) 1.6))
(make-point (* 3/4 (the grid-width)) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (the grid-width) (/ (the grid-length) 4) 0))
(list (make-point 0 (half (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (half (the grid-length))
(* (/ (the grid-height) 4) 1.8))
(make-point (half (the grid-width)) (half (the grid-length)) (the grid-height))
(make-point (* 3/4 (the grid-width)) (half (the grid-length)) (* 3/4 (the grid-height)))
(make-point (the grid-width) (half (the grid-length)) 0))
(list (make-point 0 (* 3/4 (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.4))
(the grid-height)))
(make-point (half (the grid-width)) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.8))
(the grid-height)))
(make-point (* 3/4 (the grid-width)) (* 3/4 (the grid-length))
(/ (the grid-height) 4))
(make-point (the grid-width) (* 3/4 (the grid-length)) 0))
(list (make-point 0 (the grid-length) 0)
(make-point (/ (the grid-width) 4) (the grid-length) 0)
(make-point (half (the grid-width)) (the grid-length) 0)
(make-point (* 3/4 (the grid-width)) (the grid-length) 0)
(make-point (the grid-width) (the grid-length) 0))))
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'fitted-surface-test)
(define-object fitted-surface-test-2 (fitted-surface)
:input-slots
((grid-width 4 :settable)
(grid-length 4 :settable)
(grid-height 4 :settable))
:computed-slots
((interpolant? nil)
(normals (list (list (make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1))
(list (make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1))
(list (make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1))
(list (make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1))
(list (make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1)
(make-point 0 0 1))))
(points (list (list (make-point 0 0 0)
(make-point (/ (the grid-width) 4) 0 0)
(make-point (half (the grid-width)) 0 0)
(make-point (* 3/4 (the grid-width)) 0 0)
(make-point (the grid-width) 0 0))
(list (make-point 0 (/ (the grid-length) 4) 0)
(make-point (/ (the grid-width) 4) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (half (the grid-width)) (/ (the grid-length) 4)
(* (/ (the grid-height) 4) 1.6))
(make-point (* 3/4 (the grid-width)) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (the grid-width) (/ (the grid-length) 4) 0))
(list (make-point 0 (half (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (half (the grid-length))
(* (/ (the grid-height) 4) 1.8))
(make-point (half (the grid-width)) (half (the grid-length)) (the grid-height))
(make-point (* 3/4 (the grid-width)) (half (the grid-length)) (* 3/4 (the grid-height)))
(make-point (the grid-width) (half (the grid-length)) 0))
(list (make-point 0 (* 3/4 (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.4))
(the grid-height)))
(make-point (half (the grid-width)) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.8))
(the grid-height)))
(make-point (* 3/4 (the grid-width)) (* 3/4 (the grid-length))
(/ (the grid-height) 4))
(make-point (the grid-width) (* 3/4 (the grid-length)) 0))
(list (make-point 0 (the grid-length) 0)
(make-point (/ (the grid-width) 4) (the grid-length) 0)
(make-point (half (the grid-width)) (the grid-length) 0)
(make-point (* 3/4 (the grid-width)) (the grid-length) 0)
(make-point (the grid-width) (the grid-length) 0))))
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'fitted-surface-test-2)
(define-object fitted-surface-test-3 (fitted-surface-test)
:computed-slots
((interpolant? nil)
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'fitted-surface-test-3)
| 6,252 | Common Lisp | .lisp | 132 | 41.181818 | 92 | 0.61314 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | caa46fb94e23e49f504390463e9f2b29ae565c1c609a34c6b62e6fecf37b492a | 35,692 | [
-1
] |
35,693 | joined-surfaces.lisp | lisp-mirror_gendl/regression/source/joined-surfaces.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object joined-surfaces-test (joined-surfaces)
:computed-slots
((surface (the surf-A))
(other-surface (the surf-B))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((surf-A :type 'rectangular-surface
:length 10
:width 10)
(surf-B :type 'rectangular-surface
:center (make-point 10 0 0 )
:length 10
:width 10)))
(register-test-definition 'joined-surfaces-test)
| 1,382 | Common Lisp | .lisp | 35 | 35.428571 | 71 | 0.721336 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 7508959b21b301b75719d1d8327b9aeab36083fb412e5233fdfe77c34049250b | 35,693 | [
-1
] |
35,694 | shelled-solid.lisp | lisp-mirror_gendl/regression/source/shelled-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object shelled-solid-test (base-object)
:input-slots
((points-data '(((0 0 0) (0 1 0) (0 2 0) (0 3 0))
((1 0 1) (1 1 1) (1 2 1) (1 3 1))
((2 0 2) (2 1 2) (2 2 2) (2 3 2))
((3 0 1) (3 1 1) (3 2 1) (3 3 1))
((4 0 0) (4 1 0) (4 2 0) (4 3 0)))))
:computed-slots ((surf-points (mapcar #'(lambda(row)
(mapcar #'(lambda(point)
(apply-make-point point))
row))
(the points-data)))
(regression-test-data (append (multiple-value-list
(the shell precise-properties))
(the shell %curves-to-draw%)
(the shell %lines-to-draw%)))
;;(regression-test-data (the shell %native-brep%))
)
:objects
((box :type 'box-solid
:display-controls (list :line-thickness 3 :color :green)
:length 10 :width 10 :height 10)
(fitted :type 'fitted-surface
:points (the surf-points))
(b-spline :type 'b-spline-surface
:control-points (the surf-points))
(shell :type 'shelled-solid
:tolerance 0.1
:display-controls (list :isos (list :n-v 8 :n-u 8))
:brep (the b-spline)
:distance .1)
(offset :type 'offset-solid
:sequence (:size 10)
:tolerance 0.001
:display-controls (list :isos (list :n-v 8 :n-u 8))
:brep (the b-spline)
:distance (* (1+ (the-child index)) .1))))
;;(register-test-definition 'shelled-solid-test)
| 2,292 | Common Lisp | .lisp | 59 | 34.050847 | 70 | 0.6622 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | b5008bd91432e5c5cee3d76f2fba163be19b4fdc0927b3c4efd8783e9d626a02 | 35,694 | [
-1
] |
35,695 | step-reader.lisp | lisp-mirror_gendl/regression/source/step-reader.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object step-reader-test (step-reader)
:computed-slots
((file-name (merge-pathnames "iraro.stp"
gdl-lift-utils::*lift-data-directory*))
(make-single-brep? t)
(regression-test-data (append (multiple-value-list (the (breps 0) precise-properties))
(the (breps 0) %curves-to-draw%)
(the (breps 0) %lines-to-draw%)))))
(register-test-definition 'step-reader-test)
| 1,331 | Common Lisp | .lisp | 30 | 40.6 | 90 | 0.721184 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 01536446799623a2ffeec6cf553f1e8851d30ee05df65c5050f5a420bff1e549 | 35,695 | [
-1
] |
35,696 | iges-reader.lisp | lisp-mirror_gendl/regression/source/iges-reader.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object iges-reader-test (iges-reader)
:computed-slots
((file-name (merge-pathnames "nurb_fillet.igs"
gdl-lift-utils::*lift-data-directory*))
(make-single-brep? t)
(display-controls (list :color :orange))
(properties-tolerance (* 1.0e-3 (the (breps 0) max-extent)))
(regression-test-data (append (multiple-value-list
(the (breps 0) (precise-properties :tolerance (the properties-tolerance))))
(the (breps 0) %curves-to-draw%)
(the (breps 0) %lines-to-draw%)))))
(register-test-definition 'iges-reader-test)
| 1,501 | Common Lisp | .lisp | 33 | 41.30303 | 82 | 0.716366 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 09d6c2d366e5a2cc032c6db7ce26cb7fab301f7c1b64e3de917e623b5a3ebdb2 | 35,696 | [
-1
] |
35,697 | general-dual-blend-surface.lisp | lisp-mirror_gendl/regression/source/general-dual-blend-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object general-dual-blend-surface-test (surf::general-dual-blend-surface)
:computed-slots
((f-tangent-1 #'(lambda(param)
(rotate-vector-d
(the (face-normal-vector :top))
-10
(the curve-1 (tangent param)))))
(f-tangent-2 #'(lambda(param)
(rotate-vector-d
(the (face-normal-vector :bottom))
10
(the curve-2 (tangent param)))))
(f-ratio-1 #'(lambda(param)
(declare (ignore param))
1/3))
(f-ratio-2 #'(lambda(param)
(declare (ignore param))
1/3))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((surf-1-top :type 'linear-curve
:hidden? t
:start (make-point -5 -5 0)
:end (make-point 5 -5 0))
(surf-1-bottom :type 'linear-curve
:hidden? t
:start (make-point -7 -10 -2)
:end (make-point 7 -10 -2))
(surface-1 :type 'ruled-surface
:curve-1 (the surf-1-top)
:curve-2 (the surf-1-bottom))
(curve-1 :type 'iso-curve
:display-controls (list :color :red :line-thickness 4)
:surface (the surface-1)
:parameter 0
:u-or-v :v)
(surf-2-bottom :type 'linear-curve
:hidden? t
:start (make-point -5 5 0)
:end (make-point 5 5 0))
(surf-2-top :type 'linear-curve
:hidden? t
:start (make-point -7 10 2)
:end (make-point 7 10 2))
(surface-2 :type 'ruled-surface
:curve-1 (the surf-2-bottom)
:curve-2 (the surf-2-top))
(curve-2 :type 'iso-curve
:display-controls (list :color :blue :line-thickness 4)
:surface (the surface-2)
:parameter 0
:u-or-v :v)))
(register-test-definition 'general-dual-blend-surface-test)
| 2,718 | Common Lisp | .lisp | 74 | 30.162162 | 82 | 0.641046 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 4b8e6343d408748b82409a5182cea037ec039bbba3589e04d030ec81c9c1c214 | 35,697 | [
-1
] |
35,698 | dropped-curve.lisp | lisp-mirror_gendl/regression/source/dropped-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object dropped-curve-test (dropped-curve)
:input-slots
((grid-width 10 :settable)
(grid-length 10 :settable)
(grid-height 5 :settable))
:computed-slots
((curve-in (the raised-island))
(surface (the basis-surface))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((basis-surface :type 'fitted-surface
:points (list (list (make-point 0 0 0)
(make-point (/ (the grid-width) 4) 0 0)
(make-point (half (the grid-width)) 0 0)
(make-point (* 3/4 (the grid-width)) 0 0)
(make-point (the grid-width) 0 0))
(list (make-point 0 (/ (the grid-length) 4) 0)
(make-point (/ (the grid-width) 4) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (half (the grid-width)) (/ (the grid-length) 4)
(* (/ (the grid-height) 4) 1.6))
(make-point (* 3/4 (the grid-width)) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (the grid-width) (/ (the grid-length) 4) 0))
(list (make-point 0 (half (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (half (the grid-length))
(* (/ (the grid-height) 4) 1.8))
(make-point (half (the grid-width)) (half (the grid-length)) (the grid-height))
(make-point (* 3/4 (the grid-width)) (half (the grid-length)) (* 3/4 (the grid-height)))
(make-point (the grid-width) (half (the grid-length)) 0))
(list (make-point 0 (* 3/4 (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.4))
(the grid-height)))
(make-point (half (the grid-width)) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.8))
(the grid-height)))
(make-point (* 3/4 (the grid-width)) (* 3/4 (the grid-length))
(/ (the grid-height) 4))
(make-point (the grid-width) (* 3/4 (the grid-length)) 0))
(list (make-point 0 (the grid-length) 0)
(make-point (/ (the grid-width) 4) (the grid-length) 0)
(make-point (half (the grid-width)) (the grid-length) 0)
(make-point (* 3/4 (the grid-width)) (the grid-length) 0)
(make-point (the grid-width) (the grid-length) 0))))
(raised-island :type 'b-spline-curve
:control-points (list (make-point 3 5 7) (make-point 5 8 7) (make-point 7 10 7)
(make-point 8 5 7) (make-point 7 0 7) (make-point 5 0 7)
(make-point 3 5 7)))))
(register-test-definition 'dropped-curve-test)
| 3,610 | Common Lisp | .lisp | 69 | 44.608696 | 99 | 0.608546 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9f79b4e099a99aff0dd7d66dff7dd1a81bda8876afb29ffc0e77a6cdb8aa8a97 | 35,698 | [
-1
] |
35,699 | extruded-solid.lisp | lisp-mirror_gendl/regression/source/extruded-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object extruded-solid-test (extruded-solid)
:computed-slots
((profile (the fitted))
(height 10)
(regression-test-data (progn (format t "computing regression test data~%")
(append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
(number-of-sample-points 20 :settable))
:objects
((fitted :type 'fitted-curve
:points (the circle (equi-spaced-points (the number-of-sample-points))))
(circle :type 'circle :radius 10)
))
(register-test-definition 'extruded-solid-test)
(define-object extruded-solid-test-2 (extruded-solid)
:computed-slots
((profile (the polyline))
(height 10)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((polyline :type 'global-filleted-polyline-curve-test)))
(define-object extruded-solid-test-3 (extruded-solid)
:computed-slots
((profile (the polyline))
(height 10)
(regression-test-data (append (multiple-value-list
(the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((polyline :type 'global-filleted-polyline-curve-open-test)))
;;
;; This one gives a clean manifold.
;;
;; Compare with swept-solid-test-2 which does not.
;;
;;
(define-object extruded-solid-test-4 (extruded-solid)
:computed-slots
((profile (the composed))
(height 10)
(regression-test-data (append (multiple-value-list
(the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%)))
)
:objects
((composed :type 'composed-curve
:curves (list (the polyline) (the (sides 0)) (the offset-polyline) (the (sides 1))))
(polyline :type 'global-filleted-polyline-curve-open-test)
(sides :type 'linear-curve
:sequence (:size 2)
:start (ecase (the-child index)
(0 (the polyline start))
(1 (the polyline end)))
:end (ecase (the-child index)
(0 (the offset-polyline start))
(1 (the offset-polyline end))))
(offset-polyline :type 'boxed-curve
:curve-in (the polyline)
:center (translate (the-child curve-in center)
:rear (abs (- (get-x (the polyline end))
(get-x (the polyline start))))))))
| 3,297 | Common Lisp | .lisp | 87 | 32.655172 | 91 | 0.682282 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9e5377a8afa3c5aba29492c74200f5ea37cbd7892b087026a6a89e07f99f1254 | 35,699 | [
-1
] |
35,700 | revolved-surfaces.lisp | lisp-mirror_gendl/regression/source/revolved-surfaces.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object revolved-surfaces-test (revolved-surfaces)
:computed-slots
((curves (list (the curve-1) (the curve-2)))
(regression-test-data (mapcar #'(lambda(surface)
(multiple-value-list (the-object surface b-spline-data)))
(the surfaces list-elements))))
:hidden-objects
((curve-1 :type 'arc-curve
:center (translate (the center) :right 50)
:orientation (alignment :top (the (face-normal-vector :rear)))
:start-angle 0
:end-angle (/ pi 4)
:radius 10)
(curve-2 :type 'arc-curve
:center (translate (the center) :right 50)
:orientation (alignment :top (the (face-normal-vector :rear)))
:start-angle pi
:end-angle (* 5/4 pi)
:radius 10)))
(register-test-definition 'revolved-surfaces-test)
| 1,737 | Common Lisp | .lisp | 41 | 37.317073 | 71 | 0.695678 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 967992f9995216ee0fbb914ac44d9adcb2cce58b8a885a2917df4ebd8698ca56 | 35,700 | [
-1
] |
35,701 | reparameterized-curve.lisp | lisp-mirror_gendl/regression/source/reparameterized-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package gdl-lift-tests)
(define-object reparameterized-curve-test (surf::reparameterized-curve)
:input-slots
((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)))
(curve-in (the b-spline-curve)))
:computed-slots
((regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((b-spline-curve :type 'b-spline-curve
:control-points (the points))))
(register-test-definition 'reparameterized-curve-test)
| 1,502 | Common Lisp | .lisp | 37 | 36.540541 | 72 | 0.710306 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | e33c77a1c34427223c964e901d4c42594dde35f085ac22e736cdb08f198eeb10 | 35,701 | [
-1
] |
35,702 | iso-curve.lisp | lisp-mirror_gendl/regression/source/iso-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object iso-curve-test (iso-curve)
:computed-slots
((parameter 0.5)
(points-data '(((0 0 0) (4 1 0) (8 1 0) (10 0 0) (8 -1 0) (4 -1 0) (0 0 0))
((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2))
((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4))
((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7))))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((surface :type 'b-spline-surface
:control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data)))))
(register-test-definition 'iso-curve-test)
| 1,571 | Common Lisp | .lisp | 33 | 43.424242 | 102 | 0.657407 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 1f8ac7b88ea26e8250eb95d78750755f4619748cf6a463b471a5971af3e81800 | 35,702 | [
-1
] |
35,703 | gdlxml.lisp | lisp-mirror_gendl/regression/source/gdlxml.lisp | (in-package :gdl-lift-tests)
#+nil
(define-object xmlgdl-test (gdlxml:xml2gdl)
:computed-slots ((xml-file (merge-pathnames "../data/test-file.xml" *input-files-pathname*))))
| 181 | Common Lisp | .lisp | 4 | 42.5 | 96 | 0.732558 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 4d8b2e77f29b93d895de905260a3dda8621ee5faa516cb1735d3a6f3cc525980 | 35,703 | [
-1
] |
35,704 | dual-blend-surface.lisp | lisp-mirror_gendl/regression/source/dual-blend-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object dual-blend-surface-test (surf::dual-blend-surface)
:computed-slots
((regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((surf-1-top :type 'linear-curve
:hidden? t
:start (make-point -5 -5 0)
:end (make-point 5 -5 0))
(surf-1-bottom :type 'linear-curve
:hidden? t
:start (make-point -7 -10 -2)
:end (make-point 7 -10 -2))
(surface-1 :type 'ruled-surface
:curve-1 (the surf-1-top)
:curve-2 (the surf-1-bottom))
(curve-1 :type 'iso-curve
:display-controls (list :color :red :line-thickness 4)
:surface (the surface-1)
:parameter 0
:u-or-v :v)
(surf-2-bottom :type 'linear-curve
:hidden? t
:start (make-point -5 5 0)
:end (make-point 5 5 0))
(surf-2-top :type 'linear-curve
:hidden? t
:start (make-point -7 10 2)
:end (make-point 7 10 2))
(surface-2 :type 'ruled-surface
:curve-1 (the surf-2-bottom)
:curve-2 (the surf-2-top))
(curve-2 :type 'iso-curve
:display-controls (list :color :blue :line-thickness 4)
:surface (the surface-2)
:parameter 0
:u-or-v :v)))
(register-test-definition 'dual-blend-surface-test)
| 2,227 | Common Lisp | .lisp | 58 | 32.275862 | 71 | 0.659534 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | fbf2ba286853aa3d683e2d73e75c5e7f10a30ab8b2f59cdfcbe85af45270b311 | 35,704 | [
-1
] |
35,705 | boxed-surface.lisp | lisp-mirror_gendl/regression/source/boxed-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package gdl-lift-tests)
(define-object boxed-surface-test (base-object)
:computed-slots
((points-data '(((0 0 0)(4 1 0)(8 1 0)(10 0 0)(8 -1 0)(4 -1 0)(0 0 0))
((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2))
((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4))
((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7))))
(control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data)))
(regression-test-data (mapcar #'(lambda(curve)
(multiple-value-list (the-object curve b-spline-data)))
(rest (the children)))))
:objects
((b-spline :type 'b-spline-surface
:control-points (the control-points))
(boxed :type 'boxed-surface
:surface-in (the b-spline))
(translated :type 'boxed-surface
:surface-in (the b-spline)
:center (translate (the center) :left 15))
(twisted :type 'boxed-surface
:surface-in (the boxed)
:orientation (alignment :left (the (face-normal-vector :top))
:rear (rotate-vector-d (the (face-normal-vector :rear))
30
(the (face-normal-vector :top)))))
(rotated :type 'boxed-surface
:surface-in (the b-spline)
:display-controls (list :color :purple)
:orientation (alignment :left
(rotate-vector-d (the (face-normal-vector :left))
50
(the (face-normal-vector :rear)))))
(rotated-about :type 'boxed-surface
:surface-in (the b-spline)
:display-controls (list :color :purple)
:orientation-center (translate (the center) :right 2.5)
:orientation (alignment :left
(rotate-vector-d (the (face-normal-vector :left))
45
(the (face-normal-vector :rear)))))
(moved-up :type 'boxed-surface
:surface-in (the rotated-about)
:center (translate (the rotated-about center)
:up 7
:left 5))
(straightened :type 'boxed-surface
:surface-in (the moved-up)
:orientation
(alignment :left
(rotate-vector-d (the-child surface-in (face-normal-vector :left))
45
(the-child surface-in (face-normal-vector :rear)))
:rear (the-child surface-in (face-normal-vector :rear))))
(rotated-straightened :type 'boxed-surface
:surface-in (the straightened)
:orientation (the moved-up orientation)
:orientation-center (translate (the-child surface-in center) :up 2.5))
(rotated-straightened-moved :type 'boxed-surface
:surface-in (the rotated-straightened)
:center (translate (the-child surface-in center) :right 5))
(moved-up-and-straightened :type 'boxed-surface
:surface-in (the straightened)
:center (translate (the-child orientation-center) :right 7)
:orientation (alignment :left (the-child surface-in (face-normal-vector :rear))
:front
(rotate-vector-d (the-child surface-in (face-normal-vector :left))
45
(the-child surface-in (face-normal-vector :rear))))
:orientation-center (translate (the straightened center) :up 2.5))
(moved-up-and-straightened-1 :type 'boxed-surface
:surface-in (the straightened)
:center (translate (the-child surface-in center) :right 14)
:orientation (the rotated-straightened orientation)
:orientation-center (translate (the straightened center) :up 2.5))
(moved-up-and-straightened-2 :type 'boxed-surface
:surface-in (the straightened)
:center (translate (the-child surface-in center) :right 21)
:orientation (the rotated-straightened orientation)
:orientation-center (translate (the straightened center) :up 2.5))
(transformed :type 'boxed-surface
:surface-in (the b-spline)
:center (translate (the center) :left 50)
:orientation (alignment :rear
(rotate-vector-d (the (face-normal-vector :rear))
30
(the (face-normal-vector :right)))))))
(register-test-definition 'boxed-surface-test)
| 4,983 | Common Lisp | .lisp | 107 | 39.224299 | 97 | 0.65192 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | e1799a4764aba7f48c17a9753695dddcd7293ada846894f91025ba30d70c6c29 | 35,705 | [
-1
] |
35,706 | compatible-curves.lisp | lisp-mirror_gendl/regression/source/compatible-curves.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object compatible-curves-test (compatible-curves)
:computed-slots
((curve-list (list (the b-spline) (the linear-curve)))
(regression-test-data (append-elements (the curves) (multiple-value-list (the-element b-spline-data)))))
:objects
((b-spline :type 'b-spline-curve
:control-points (list (make-point 0 0 0)
(make-point -1 0 0)
(make-point -1 1 0)
(make-point 0 1 0)))
(linear-curve :type 'linear-curve
:start (make-point 0 1 0)
:end (make-point 4 1 0))))
(register-test-definition 'compatible-curves-test)
| 1,510 | Common Lisp | .lisp | 35 | 38.942857 | 108 | 0.711525 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | b382e182769106eacfa7d018c8c19980bfcde936b1ccc1b0b75689ab738cc505 | 35,706 | [
-1
] |
35,707 | brep-intersect.lisp | lisp-mirror_gendl/regression/source/brep-intersect.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package gdl-lift-tests)
(define-object brep-intersect-test (brep-intersect)
:computed-slots
((points-data '(((0 0 0)(4 1 0)(8 1 0)(10 0 0)(8 -1 0)(4 -1 0)(0 0 0))
((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2))
((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4))
((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7))))
(control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data)))
(brep (the b-spline brep))
(other-brep (the plane brep))
(regression-test-data (mapcar #'(lambda(curve)
(multiple-value-list (the-object curve b-spline-data)))
(the edges list-elements))))
:objects
((b-spline :type 'b-spline-surface
:control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data)))
(plane :type 'planar-surface
:p00 (make-point -1 -2 3.5)
:p01 (make-point 10 -2 3.5)
:p10 (make-point -1 2 3.5)
:p11 (make-point 10 2 3.5))))
(register-test-definition 'brep-intersect-test)
| 1,953 | Common Lisp | .lisp | 42 | 42.238095 | 100 | 0.655556 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 0e80e2c78bf43e3145f8cdbdd9ccc64df9e2d0deceaf2200ba5af483d18db6cf | 35,707 | [
-1
] |
35,708 | united-solid.lisp | lisp-mirror_gendl/regression/source/united-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object united-solid-test (united-solid)
:computed-slots
((brep (the cylinder))
(other-brep (list (the box) (the box2) (the box3)))
(error-on-invalid? nil)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((cylinder :type 'cylinder-solid
:radius 10
:length 20)
(box :type 'box-solid
:length 10
:height 10
:width 30)
(box2 :type 'box-solid
:length 5
:height 5
:width 20
:center (the box (face-center :right)))
(box3 :type 'box-solid
:length 2
:height 2
:width 10
:center (the box2 (face-center :right)))))
(register-test-definition 'united-solid-test)
(define-object united-solid-bt-test (surf::boolean-tree)
:computed-slots
((brep (the cylinder))
(other-brep (the box))
(breps (list (the brep) (the other-brep)))
(operation :union)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((cylinder :type 'cylinder-solid
:radius 10
:length 20)
(box :type 'box-solid
:length 10
:height 10
:width 30)
))
(register-test-definition 'united-solid-test)
| 2,319 | Common Lisp | .lisp | 67 | 28.850746 | 80 | 0.681139 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 4e7a8d8e0a1305e149a6e6529e4b97cd3b4e52e455210f4c2a95574e813ede9c | 35,708 | [
-1
] |
35,709 | composed-curves.lisp | lisp-mirror_gendl/regression/source/composed-curves.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object composed-curves-test (composed-curves)
:computed-slots
((curves-in (append (the poly1 ordered-curves) (the poly2 ordered-curves)))
(regression-test-data (mapcar #'(lambda(curve)
(multiple-value-list (the-object curve b-spline-data)))
(the curves list-elements))))
:objects
((poly1 :type 'global-filleted-polyline-curves
:default-radius 5
:vertex-list (list (make-point 1 0 0)
(make-point 10 10 0)
(make-point 30 10 0)
(make-point 40 0 0)
(make-point 30 -10 0)
(make-point 10 -10 0)
(make-point 1 0 0)))
(poly2 :type 'global-filleted-polyline-curves
:default-radius 5
:vertex-list (list (make-point -1 0 0)
(make-point -10 10 0)
(make-point -30 10 0)
(make-point -40 0 0)
(make-point -30 -10 0)
(make-point -10 -10 0)
(make-point -1 0 0)))))
(register-test-definition 'composed-curves-test)
| 1,898 | Common Lisp | .lisp | 47 | 34.893617 | 78 | 0.674877 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 74921484bcf0abbe8dabaebab95bacb6cb38b75f06885f0f5d50ea161b0568b0 | 35,709 | [
-1
] |
35,710 | parameters.lisp | lisp-mirror_gendl/regression/source/parameters.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
#+nil
(defparameter *input-files-pathname*
(merge-pathnames
(make-pathname :directory (append (butlast (pathname-directory *source-pathname*))
(list "input-files"))
:device (pathname-device *source-pathname*))))
#+nil
(defparameter *airfoil-library-pathname*
(make-pathname :directory (append (butlast (pathname-directory *source-pathname*))
(list "airfoil-library"))
:device (pathname-device *source-pathname*)))
| 1,391 | Common Lisp | .lisp | 32 | 39.5 | 87 | 0.724497 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | bd1eda1ed67ff149ef876842df710064c87301e92736215e1dfd81ec277d836e | 35,710 | [
-1
] |
35,711 | planar-section-curve.lisp | lisp-mirror_gendl/regression/source/planar-section-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object planar-section-curve-test (planar-section-curve)
:input-slots
((grid-width 4 :settable)
(grid-length 4 :settable)
(grid-height 4 :settable))
:computed-slots
((surface (the test-surf))
(plane-normal (the (face-normal-vector :top)))
(plane-point (make-point 0 0 2))
(points (list (list (make-point 0 0 0)
(make-point (/ (the grid-width) 4) 0 0)
(make-point (half (the grid-width)) 0 0)
(make-point (* 3/4 (the grid-width)) 0 0)
(make-point (the grid-width) 0 0))
(list (make-point 0 (/ (the grid-length) 4) 0)
(make-point (/ (the grid-width) 4) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (half (the grid-width)) (/ (the grid-length) 4)
(* (/ (the grid-height) 4) 1.6))
(make-point (* 3/4 (the grid-width)) (/ (the grid-length) 4) (/ (the grid-height) 4))
(make-point (the grid-width) (/ (the grid-length) 4) 0))
(list (make-point 0 (half (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (half (the grid-length))
(* (/ (the grid-height) 4) 1.8))
(make-point (half (the grid-width)) (half (the grid-length)) (the grid-height))
(make-point (* 3/4 (the grid-width)) (half (the grid-length)) (* 3/4 (the grid-height)))
(make-point (the grid-width) (half (the grid-length)) 0))
(list (make-point 0 (* 3/4 (the grid-length)) 0)
(make-point (/ (the grid-width) 4) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.4))
(the grid-height)))
(make-point (half (the grid-width)) (* 3/4 (the grid-length))
(min (* (/ (the grid-height) 4) (* (/ (the grid-height) 4) 1.8))
(the grid-height)))
(make-point (* 3/4 (the grid-width)) (* 3/4 (the grid-length))
(/ (the grid-height) 4))
(make-point (the grid-width) (* 3/4 (the grid-length)) 0))
(list (make-point 0 (the grid-length) 0)
(make-point (/ (the grid-width) 4) (the grid-length) 0)
(make-point (half (the grid-width)) (the grid-length) 0)
(make-point (* 3/4 (the grid-width)) (the grid-length) 0)
(make-point (the grid-width) (the grid-length) 0))))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((test-surf :type 'fitted-surface
:points (the points))))
(register-test-definition 'planar-section-curve-test)
| 3,331 | Common Lisp | .lisp | 67 | 44.283582 | 92 | 0.638006 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | bce17ef68c5b79e479a46c334f836f2778d22564da886b89aa321f44b801da7b | 35,711 | [
-1
] |
35,712 | lofted-surface.lisp | lisp-mirror_gendl/regression/source/lofted-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object lofted-surface-test (lofted-surface)
:computed-slots
((curves (list (the curve-1) (the curve-2) (the curve-3) (the curve-4)))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((curve-1 :type 'b-spline-curve
:display-controls (list :color :red :line-thickness 3)
:control-points (list (make-point 0 0 0)
(make-point 1 1 0)
(make-point 0 1 0)
(make-point 0 0 0)))
(curve-2 :type 'b-spline-curve
:display-controls (list :color :red :line-thickness 3)
:control-points (list (make-point 0 0 1)
(make-point -1 1 1)
(make-point 0 1 1)
(make-point 0 0 1)))
(curve-3 :type 'b-spline-curve
:display-controls (list :color :red :line-thickness 3)
:control-points (list (make-point 0 0 2)
(make-point -1 -1 2)
(make-point 0 -1 2)
(make-point 0 0 2)))
(curve-4 :type 'b-spline-curve
:display-controls (list :color :red :line-thickness 3)
:control-points (list (make-point 0 0 3)
(make-point 1 -1 3)
(make-point 0 -1 3)
(make-point 0 0 3)))))
(register-test-definition 'lofted-surface-test)
(define-object lofted-surface-test-2 (lofted-surface)
:input-slots
((span 0.5 :settable)
(profile-degree 3 :settable)
(c-root-profile 0.3 :settable)
(c-tip-profile 0.24 :settable)
(airfoil-data '((1.0 0 0.0)
(0.9994161 0 0.0013419) (0.9976658 0 0.001587) (0.9947532 0 0.0019938)
(0.990685 0 0.0025595) (0.9854709 0 0.0032804)
(0.9791229 0 0.0041519) (0.9716559 0 0.0051685) (0.9630873 0 0.0063238)
(0.9534372 0 0.0076108) (0.942728 0 0.0090217) (0.9309849 0 0.0105485)
(0.9182351 0 0.0121823) (0.9045085 0 0.0139143) (0.8898372 0 0.0157351)
(0.8742554 0 0.0176353) (0.8577995 0 0.0196051) (0.8405079 0 0.0216347)
(0.8224211 0 0.0237142) (0.8035813 0 0.0258337) (0.7840324 0 0.0279828)
(0.7638202 0 0.0301515) (0.7429917 0 0.0323294) (0.7215958 0 0.0345058)
(0.6996823 0 0.03667) (0.6773025 0 0.0388109) (0.6545085 0 0.0409174)
(0.6313537 0 0.0429778) (0.6078921 0 0.0449802) (0.5841786 0 0.0469124)
(0.5602683 0 0.0487619) (0.5362174 0 0.0505161) (0.5120819 0 0.052162)
(0.4879181 0 0.0536866) (0.4637826 0 0.0550769) (0.4397317 0 0.05632)
(0.4158215 0 0.0574033) (0.3921079 0 0.0583145) (0.3686463 0 0.0590419)
(0.3454915 0 0.0595747) (0.3226976 0 0.0599028) (0.3003177 0 0.0600172)
(0.2784042 0 0.0599102) (0.2570083 0 0.0595755) (0.2361799 0 0.0590081)
(0.2159676 0 0.0582048) (0.1964187 0 0.057164) (0.1775789 0 0.0558856)
(0.1594921 0 0.0543715) (0.1422005 0 0.0526251) (0.1257446 0 0.0506513)
(0.1101628 0 0.0484567) (0.0954915 0 0.0460489) (0.0817649 0 0.0434371)
(0.0690152 0 0.040631) (0.057272 0 0.0376414) (0.0465628 0 0.0344792)
(0.0369127 0 0.0311559) (0.0283441 0 0.0276827) (0.0208771 0 0.0240706)
(0.0145291 0 0.02033) (0.0093149 0 0.0164706) (0.0052468 0 0.0125011)
(0.0023342 0 0.0084289) (5.839e-4 0 0.0042603) (0.0 0 0.0)
(5.839e-4 0 -0.0042603 )(0.0023342 0 -0.0084289 )(0.0052468 0 -0.0125011 )
(0.0093149 0 -0.0164706 )(0.0145291 0 -0.02033 )(0.0208771 0 -0.0240706 )
(0.0283441 0 -0.0276827 )(0.0369127 0 -0.0311559 )(0.0465628 0 -0.0344792 )
(0.057272 0 -0.0376414 )(0.0690152 0 -0.040631 )(0.0817649 0 -0.0434371 )
(0.0954915 0 -0.0460489 )(0.1101628 0 -0.0484567 )(0.1257446 0 -0.0506513 )
(0.1422005 0 -0.0526251 )(0.1594921 0 -0.0543715 )(0.1775789 0 -0.0558856 )
(0.1964187 0 -0.057164 )(0.2159676 0 -0.0582048 )(0.2361799 0 -0.0590081 )
(0.2570083 0 -0.0595755 )(0.2784042 0 -0.0599102 )(0.3003177 0 -0.0600172 )
(0.3226976 0 -0.0599028 )(0.3454915 0 -0.0595747 )(0.3686463 0 -0.0590419 )
(0.3921079 0 -0.0583145 )(0.4158215 0 -0.0574033 )(0.4397317 0 -0.05632 )
(0.4637826 0 -0.0550769 )(0.4879181 0 -0.0536866 )(0.5120819 0 -0.052162 )
(0.5362174 0 -0.0505161 )(0.5602683 0 -0.0487619 )(0.5841786 0 -0.0469124 )
(0.6078921 0 -0.0449802 )(0.6313537 0 -0.0429778 )(0.6545085 0 -0.0409174 )
(0.6773025 0 -0.0388109 )(0.6996823 0 -0.03667 )(0.7215958 0 -0.0345058 )
(0.7429917 0 -0.0323294 )(0.7638202 0 -0.0301515 )(0.7840324 0 -0.0279828 )
(0.8035813 0 -0.0258337 )(0.8224211 0 -0.0237142 )(0.8405079 0 -0.0216347 )
(0.8577995 0 -0.0196051 )(0.8742554 0 -0.0176353 )(0.8898372 0 -0.0157351 )
(0.9045085 0 -0.0139143 )(0.9182351 0 -0.0121823 )(0.9309849 0 -0.0105485 )
(0.942728 0 -0.0090217 )(0.9534372 0 -0.0076108 )(0.9630873 0 -0.0063238 )
(0.9716559 0 -0.0051685 )(0.9791229 0 -0.0041519 )(0.9854709 0 -0.0032804 )
(0.990685 0 -0.0025595 )(0.9947532 0 -0.0019938 )(0.9976658 0 -0.001587 )
(0.9994161 0 -0.0013419 )(1.0 0 0.0 ))))
:computed-slots
((airfoil-points (mapcar #'apply-make-point (the airfoil-data)))
(regression-test-data (multiple-value-list (the b-spline-data)))
;;(synchronized? t)
(tolerance (* (the span) 1.0e-5))
(curves (list (the profile-root) (the profile-tip))))
:objects
(
(p-curve-in :type 'b-spline-curve
:hidden? t
:degree (the profile-degree)
:control-points (the airfoil-points))
#+nil
(p-curve-in :type 'fitted-curve
:hidden? t
:degree (the profile-degree)
:points (the airfoil-points)
:interpolant? t
)
(profile-root :type 'boxed-curve
:hidden? t
:center (make-point 0 0 0 )
:scale (the c-root-profile)
:curve-in (the p-curve-in ))
(profile-tip :type 'boxed-curve
:hidden? t
:center (translate (the center)
:right (/ (- (the c-root-profile)
(the c-tip-profile))
2)
:rear (the span))
:scale (the c-tip-profile)
:curve-in (the p-curve-in))))
(register-test-definition 'lofted-surface-test-2)
;;
;; Memory leak results:: 2 MB for 1000 iterations.
;;
| 6,918 | Common Lisp | .lisp | 139 | 43.705036 | 81 | 0.646664 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 113104071b37064488d244d6b76e5de14534d305f9417a8a211df7df72c352cb | 35,712 | [
-1
] |
35,713 | b-spline-surface.lisp | lisp-mirror_gendl/regression/source/b-spline-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object b-spline-surface-test (b-spline-surface)
:computed-slots
((points-data '(((0 0 0)(4 1 0)(8 1 0)(10 0 0)(8 -1 0)(4 -1 0)(0 0 0))
((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2))
((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4))
((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7))))
(control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data)))
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'b-spline-surface-test)
| 1,506 | Common Lisp | .lisp | 30 | 46.366667 | 98 | 0.666437 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 654096b56595d8f854b9a4e81f1c55b7cb57a56a3b9c96cf53d51b8365c4c2fa | 35,713 | [
-1
] |
35,714 | split-surface.lisp | lisp-mirror_gendl/regression/source/split-surface.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object split-surface-test (base-object)
:computed-slots ((projection-point (make-point 10 0 3))
(projection-vector (make-vector 1 0 0))
(u-or-v :u :settable)
(keep-side :left :settable)
(regression-test-data (multiple-value-list (the split b-spline-data))))
:objects
((test-surface :type 'test-b-spline-surface
:display-controls nil)
(split :type 'split-surface
:display-controls (list :color :red :line-thickness 3)
:surface-in (the test-surface)
:pass-down (keep-side u-or-v projection-point projection-vector))))
(register-test-definition 'split-surface-test)
| 1,519 | Common Lisp | .lisp | 35 | 40.514286 | 76 | 0.74231 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | bcf5bfc128e1cecf529b67be5872dc6da0c79e0525eec61adee5b59d90aedd63 | 35,714 | [
-1
] |
35,715 | swept-solid.lisp | lisp-mirror_gendl/regression/source/swept-solid.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object swept-solid-test (swept-solid)
:computed-slots
((facial-brep (the trimmed brep))
(vector (make-vector 0 0 1))
(distance 10)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:hidden-objects
((trimmed :type 'trimmed-surface
:uv-inputs t
:island (the island-3d uv-curve)
:holes (list (the hole uv-curve))
:basis-surface (the basis))
(basis :type 'planar-surface
:p00 (make-point 0 0 0)
:p01 (make-point 0 10 0)
:p10 (make-point 10 0 0)
:p11 (make-point 15 15 0))
(island-3d :type 'projected-curve
:curve-in (the raised-island)
:surface (the basis)
:projection-vector (make-vector 0 0 -1))
(hole :type 'projected-curve
:curve-in (the raised-hole)
:surface (the basis)
:projection-vector (make-vector 0 0 -1))
(raised-hole :type 'b-spline-curve
:control-points (list (make-point 3.5 4.5 10)
(make-point 4.5 6 10)
(make-point 5.5 7 10)
(make-point 6 4.5 10)
(make-point 5.5 2 10)
(make-point 4.5 2 10)
(make-point 3.5 4.5 10)))
(raised-island :type 'b-spline-curve
:control-points (list (make-point 3 5 1)
(make-point 5 8 1)
(make-point 7 10 1)
(make-point 8 5 1)
(make-point 7 0 1)
(make-point 5 0 1)
(make-point 3 5 1)))))
(register-test-definition 'swept-solid-test)
;;
;; This one does not give a clean manifold.
;;
;; Compare with extruded-solid-test-4 which gives a clean one.
;;
;;
(define-object swept-solid-test-2 (swept-solid)
:computed-slots
((facial-brep (the e-s-t-3))
(vector (make-vector 0 1 0))
(distance 10)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((e-s-t-3 :type 'extruded-solid-test-3)))
(define-object swept-solid-test-3 (swept-solid)
:computed-slots
((facial-brep (the ruled brep))
(vector (make-vector 0 0 1))
(distance 10)
(regression-test-data (append (multiple-value-list (the precise-properties))
(the %curves-to-draw%)
(the %lines-to-draw%))))
:objects
((polyline :type 'global-filleted-polyline-curve-open-test)
(offset-polyline :type 'boxed-curve
:curve-in (the polyline)
:center (translate (the-child curve-in center)
:rear (abs (- (get-x (the polyline end))
(get-x (the polyline start))))))
(ruled :type 'ruled-surface
:curve-1 (the polyline)
:curve-2 (the offset-polyline))))
| 3,699 | Common Lisp | .lisp | 99 | 31.010101 | 80 | 0.651924 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | f5066a40af366cd081c263529841c5210132fbc3cf1267db1db77dc8f47acda8 | 35,715 | [
-1
] |
35,716 | elliptical-curve.lisp | lisp-mirror_gendl/regression/source/elliptical-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object elliptical-curve-test (elliptical-curve)
:computed-slots
((center (make-point 0 0 0))
(major-axis-length 10)
(minor-axis-length 5)
(start-angle 0)
(end-angle 2pi)
(regression-test-data (multiple-value-list (the b-spline-data)))))
(register-test-definition 'elliptical-curve-test)
| 1,261 | Common Lisp | .lisp | 30 | 38.233333 | 72 | 0.7257 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | a003f7c4cab2b67419011e9c4f9a7ad372f6d545cb1bde3e0ce6c7758a0f58a6 | 35,716 | [
-1
] |
35,717 | arc-curve.lisp | lisp-mirror_gendl/regression/source/arc-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object arc-curve-test (arc-curve)
:computed-slots
((center (make-point 0 0 0))
(radius 10)
(start-angle 0)
(end-angle 2pi)
(regression-test-data (list (multiple-value-list (the b-spline-data))
(the %curves-to-draw%)
))))
(register-test-definition 'arc-curve-test)
| 1,247 | Common Lisp | .lisp | 31 | 36.225806 | 75 | 0.71345 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 3665d462d4b2d9fab194caf988e8947b041dab53ef7b08145438dc6a6611369b | 35,717 | [
-1
] |
35,718 | approximated-curve.lisp | lisp-mirror_gendl/regression/source/approximated-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object approximated-curve-test (base-object)
:input-slots
((sample-b-spline-data
'((#(-7.773502691896258 10.0 0.0) #(-7.76304131662674 10.0 0.0035356993309923) #(-7.746775287947699 10.0 0.0067001904580447) #(-7.7253289934578415 10.0 0.0091817670732663)
#(-7.709372706886673 10.0 0.0109178383762297) #(-7.693497618275636 10.0 0.0129741578942581) #(-7.676981089448407 10.0 0.0152725944452429) #(-7.660626985913543 10.0 0.0176076438762828)
#(-7.644400043044812 10.0 0.0198301741704749) #(-7.628572854579257 10.0 0.0218811393098875) #(-7.612456095337886 10.0 0.023892087537815) #(-7.596123157036033 10.0 0.025876731740358)
#(-7.5797886014351645 10.0 0.0278392394943197) #(-7.563598247718005 10.0 0.0297977372116626) #(-7.54734474235553 10.0 0.0317827355165938) #(-7.530817428296935 10.0 0.0338094455691551)
#(-7.514499984995836 10.0 0.0358111584598995) #(-7.498530032892328 10.0 0.037762615650263) #(-7.482560694806967 10.0 0.0396996233035483) #(-7.466938587271525 10.0 0.0415717500361984)
#(-7.45613073401155 10.0 0.0428492028474684) #(-7.445702016561547 10.0 0.04407409984323) #(-7.439862498458236 10.0 0.0447555129227675) #(-7.429535001467346 10.0 0.0459531655261334)
#(-7.423946015929491 10.0 0.0465975377728551) #(-7.413554192167366 10.0 0.0477892161812883) #(-7.407595596706495 10.0 0.0484686195293404) #(-7.396934499325897 10.0 0.049677834187285)
#(-7.391025013196135 10.0 0.0503446277462212) #(-7.380668397266659 10.0 0.0515077909624895) #(-7.374959869886305 10.0 0.0521461185088044) #(-7.36464849713204 10.0 0.05329441651439)
#(-7.3587350147730115 10.0 0.0539501551169936) #(-7.348489965069932 10.0 0.0550810605426388) #(-7.342793963594458 10.0 0.0557070781305422) #(-7.332490622079339 10.0 0.0568343892437064)
#(-7.3264770440672065 10.0 0.0574891649794912) #(-7.316219293859572 10.0 0.0586004349229853) #(-7.310517864890045 10.0 0.0592151399809975) #(-7.300540086253307 10.0 0.0602855343476251)
#(-7.294748391590457 10.0 0.0609037603868834) #(-7.284555892216601 10.0 0.061985955452512) #(-7.278577998313509 10.0 0.062617198511794) #(-7.268114585011737 10.0 0.0637157114288265)
#(-7.261986919319522 10.0 0.0643552477004073) #(-7.2514547970306005 10.0 0.0654480650996109) #(-7.245363578736502 10.0 0.066076354340049) #(-7.235168395459871 10.0 0.0671217900147562)
#(-7.2293285386923625 10.0 0.0677172614089348) #(-7.219456797793601 10.0 0.0687181850892115) #(-7.21363748676987 10.0 0.0693049508093313) #(-7.203721331045569 10.0 0.0702991235190865)
#(-7.197774951476638 10.0 0.0708918760373581) #(-7.18753366922008 10.0 0.071906820780931) #(-7.181328324859931 10.0 0.0725180648535886) #(-7.170908624453838 10.0 0.0735382495023682)
#(-7.164741045570452 10.0 0.0741384240225961) #(-7.154470299979475 10.0 0.0751317627718068) #(-7.1483716586933825 10.0 0.0757179834474372) #(-7.138406833936611 10.0 0.0766699111117332)
#(-7.132501722803377 10.0 0.0772306457809111) #(-7.12244815794467 10.0 0.0781794021319588) #(-7.116194798062766 10.0 0.0787657100109435) #(-7.105880729941813 10.0 0.0797262397246034)
#(-7.099656569353997 10.0 0.0803020171513102) #(-7.089330480447966 10.0 0.0812507479304588) #(-7.083006810743995 10.0 0.0818277014224611) #(-7.0730076945596645 10.0 0.0827335903150743)
#(-7.067069212658176 10.0 0.0832680013237252) #(-7.057382524393892 10.0 0.0841338221164179) #(-7.0513228782074515 10.0 0.0846717275930971) #(-7.041364101581027 10.0 0.0855495109968372)
#(-7.035106540724323 10.0 0.0860970019877134) #(-7.024857742651612 10.0 0.0869868797241497) #(-7.018438815809276 10.0 0.087539916228507) #(-7.008168401811841 10.0 0.0884178150543803)
#(-7.00184087536049 10.0 0.0889544270356334) #(-6.9919619641004545 10.0 0.0897854973995385) #(-6.985881827579846 10.0 0.0902930555610231) #(-6.976281029598491 10.0 0.0910882693796495)
#(-6.970184675056803 10.0 0.091589260852436) #(-6.960320705968006 10.0 0.0923932980242485) #(-6.953917746465384 10.0 0.0929107533519837) #(-6.943757762558306 10.0 0.0937245181023455)
#(-6.937303992646001 10.0 0.0942367919470313) #(-6.9271520790382235 10.0 0.0950351703452132) #(-6.920707811824021 10.0 0.0955372165209965) #(-6.910885266876965 10.0 0.0962951353561948)
#(-6.904716963255798 10.0 0.096766697374172) #(-6.895200295978004 10.0 0.0974873900684733) #(-6.889018398304428 10.0 0.0979511004533426) #(-6.8792396786986085 10.0 0.0986773910779738)
#(-6.8727507213 10.0 0.0991543261574633) #(-6.86267690754424 10.0 0.0998867125969024) #(-6.856136640740504 10.0 0.100356993136921) #(-6.846050345447107 10.0 0.1010740145138523)
#(-6.839489198598122 10.0 0.1015350665777411) #(-6.829441747557248 10.0 0.1022327061061873) #(-6.82289308331905 10.0 0.1026819075455008) #(-6.813152437915218 10.0 0.1033417487088309)
#(-6.806847948189532 10.0 0.103763701703458) #(-6.7971454958195565 10.0 0.1044050485135838) #(-6.790595307231813 10.0 0.10483231339683) #(-6.780922064334754 10.0 0.1054546472054939)
#(-6.77458575320461 10.0 0.1058569326392236) #(-6.7649029807976975 10.0 0.1064632879605449) #(-6.758284636701557 10.0 0.1068717205935851) #(-6.748340665523174 10.0 0.1074760046701189)
#(-6.741671570163981 10.0 0.1078750063466806) #(-6.731717886166939 10.0 0.1084609002957398) #(-6.7250260196879 10.0 0.1088483306291875) #(-6.715132250830737 10.0 0.1094113701746257)
#(-6.708479289674014 10.0 0.1097833660497434) #(-6.698863733855831 10.0 0.1103113585573882) #(-6.692407555733223 10.0 0.1106596095578191) #(-6.683112518678094 10.0 0.1111518410008553)
#(-6.67673768062156 10.0 0.1114832653763077) #(-6.667240402771452 10.0 0.1119675047371582) #(-6.660514775321519 10.0 0.1123033129775543) #(-6.650681029972996 10.0 0.1127835983503758)
#(-6.643918945899163 10.0 0.1131064056804846) #(-6.63405272844892 10.0 0.1135663439198465) #(-6.627254408957563 10.0 0.1138754999668116) #(-6.617707456082231 10.0 0.1142985673023449)
#(-6.611225484562257 10.0 0.1145786891314138) #(-6.60204805594244 10.0 0.1149649311892426) #(-6.595561879720703 10.0 0.1152306714612809) #(-6.586146787784009 10.0 0.1156055153436167)
#(-6.579359503332465 10.0 0.1158674765410608) #(-6.569607126249581 10.0 0.1162316741844863) #(-6.562716518300558 10.0 0.1164802471836087) #(-6.552941578381875 10.0 0.1168201535727847)
#(-6.546090216293524 10.0 0.1170494074887217) #(-6.536674084104508 10.0 0.117351835565929) #(-6.530101252192292 10.0 0.1175545076386553) #(-6.521003931182706 10.0 0.1178230920419217)
#(-6.514431925615438 10.0 0.1180084927017307) #(-6.505237782335364 10.0 0.1182554027074824) #(-6.498513444650254 10.0 0.1184266239748961) #(-6.488983008492481 10.0 0.1186555956582973)
#(-6.48200268637703 10.0 0.1188128917257091) #(-6.472326149681036 10.0 0.119016053562057) #(-6.465389207391072 10.0 0.1191511200864016) #(-6.455601236135456 10.0 0.1193262289159263)
#(-6.448443729690395 10.0 0.1194424780868816) #(-6.438958198675441 10.0 0.1195804860871952) #(-6.432273317606395 10.0 0.1196673012040853) #(-6.422976238615972 10.0 0.1197731501514096)
#(-6.4159621089377605 10.0 0.1198409999468651) #(-6.4067002169151355 10.0 0.1199142428159179) #(-6.399997171744239 10.0 0.119956098103827) #(-6.390775586474153 10.0 0.1199979664750528)
#(-6.383766014520722 10.0 0.1200169608096984) #(-6.374398451275458 10.0 0.1200248790095977) #(-6.367508232676765 10.0 0.1200180617465295) #(-6.358204641636406 10.0 0.1199913666687163)
#(-6.351212499117087 10.0 0.1199579262946732) #(-6.34179811653411 10.0 0.1198940830107079) #(-6.334722008984675 10.0 0.1198318598583616) #(-6.325243506895607 10.0 0.1197286664953724)
#(-6.3181038668924225 10.0 0.1196359024164523) #(-6.3086233644061815 10.0 0.1194922029896446) #(-6.301482992162023 10.0 0.1193683670372235)
#(-6.2919924776063425 10.0 0.1191825584163038) #(-6.284793044978927 10.0 0.1190252258627906) #(-6.2753314970647045 10.0 0.1187965753264672) #(-6.26821135846841 10.0 0.1186078391724031)
#(-6.259162952769228 10.0 0.1183465300397597) #(-6.252357920075809 10.0 0.1181346604145395) #(-6.243732250120057 10.0 0.1178464349390531) #(-6.237024615970206 10.0 0.117607149463944)
#(-6.22847504378218 10.0 0.1172819358381489) #(-6.221661738722191 10.0 0.1170066698163893) #(-6.212734929396275 10.0 0.1166237921552943) #(-6.205560407960056 10.0 0.1162969301785835)
#(-6.196251975857688 10.0 0.1158468244886666) #(-6.188964185271005 10.0 0.1154735323164374) #(-6.179555494737541 10.0 0.1149639153426461) #(-6.172229381962318 10.0 0.1145450494936365)
#(-6.162856146944508 10.0 0.113980051461802) #(-6.155565515353094 10.0 0.1135177665315744) #(-6.146209923750142 10.0 0.1128942970314755) #(-6.138855137820279 10.0 0.112380030061237)
#(-6.129655628386858 10.0 0.1117056172410459) #(-6.122486612998066 10.0 0.111156182233171) #(-6.11363265472315 10.0 0.110447376638818) #(-6.10657159410418 10.0 0.1098584591558712)
#(-6.097764739903218 10.0 0.1090932742430056) #(-6.0906136679603495 10.0 0.1084460244904774) #(-6.081792237411942 10.0 0.1076133101575569) #(-6.074656622637572 10.0 0.106911620109585)
#(-6.065558573551578 10.0 0.1059791445416934) #(-6.058094902257685 10.0 0.105180297224725) #(-6.04902211746673 10.0 0.1041654080838163) #(-6.041837834442202 10.0 0.1033285781165379)
#(-6.032806538284214 10.0 0.102232676388748) #(-6.025326943718607 10.0 0.1012858590168515) #(-6.016324551464302 10.0 0.1000962619743535) #(-6.009099370537937 10.0 0.0991026392362128)
#(-6.000144802087108 10.0 0.0978213410260762) #(-5.992672802847265 10.0 0.0967077356358815) #(-5.983682684099936 10.0 0.095311303764513) #(-5.976390894901862 10.0 0.0941327969909632)
#(-5.967597701948485 10.0 0.092651171023629) #(-5.960300625393035 10.0 0.091369004729541) #(-5.951819042895475 10.0 0.0898129037222759) #(-5.944827122197059 10.0 0.0884764825079818)
#(-5.9364937900430546 10.0 0.086815333082949) #(-5.929316123058646 10.0 0.0853215712223041) #(-5.920853977349434 10.0 0.0834809963775036) #(-5.913697488126982 10.0 0.081855290446912)
#(-5.905045875020715 10.0 0.0797946852900259) #(-5.897633195865675 10.0 0.077937627548088) #(-5.888869222952547 10.0 0.0756214894583634) #(-5.881576422780188 10.0 0.0735895003825018)
#(-5.8730488606276685 10.0 0.071078664456186) #(-5.865886603820401 10.0 0.0688505661471062) #(-5.857659076163453 10.0 0.0661282191187038) #(-5.8506956581380045 10.0 0.0636758008622684)
#(-5.8427993520796395 10.0 0.0607060179365281) #(-5.836006841543422 10.0 0.0579805075953104) #(-5.828141782273885 10.0 0.0545732138995477) #(-5.821264105869612 10.0 0.0513305536611062)
#(-5.813396489418997 10.0 0.0472425696093425) #(-5.806736741014998 10.0 0.0434068855227238) #(-5.799296800365852 10.0 0.0385347465920627) #(-5.793149838865298 10.0 0.0339017049050897)
#(-5.786639267262249 10.0 0.02799360148602) #(-5.781555952133565 10.0 0.0222871988704581) #(-5.77690049447455 10.0 0.0149171833984971) #(-5.774143850809992 10.0 0.0076254582681704)
#(-5.773504871989952 10.0 0.0021812762824132) #(-5.77350372489622 10.0 -5.432357e-10))
(1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0)
(0.0 0.0 0.0 0.0 0.0160453781542143 0.0241470160269717 0.0317935799490915 0.0398053040025856 0.0478086834801164 0.0560582201696031 0.0639202701209087 0.0718503545073776
0.0797433850046513 0.087981750276748 0.0960087041824917 0.1039831218391125 0.112029495827222 0.1201752268087684 0.1282605498138822 0.136005192477863 0.1438242190390603
0.1519870644337011 0.1593306835295498 0.1598487740853562 0.1674658650196929 0.1680104087509454 0.175157710986505 0.1757272662987668 0.1833705173786548 0.183966778279312
0.1915177150798282 0.1921404682290536 0.1993060375256694 0.1999541159685396 0.2074081735084615 0.2080825976726782 0.2151502427534925 0.2158498418097879 0.2234099696672682
0.2241364268834526 0.2312069092585329 0.2319587197887401 0.2390267110021689 0.239803949187276 0.2470314540979864 0.2478347213119199 0.2551668057971311 0.2559965267399797
0.2633214412146924 0.2641776785913368 0.2711080693997827 0.271989626560843 0.2788004837617649 0.2797070543520855 0.2865857660092436 0.2875176520073938 0.294691617040477
0.2956498608401993 0.3028107414290341 0.303795386191314 0.3108677223812281 0.3118785660342093 0.3186289517157898 0.3196650325637266 0.3267875123448071 0.3278501223901527
0.3348376542335923 0.3359264409310518 0.343017473844114 0.3441328588668275 0.3507020846059745 0.3518424576829762 0.3585158400916831 0.3596816211629636 0.366600003006972
0.3677920713565625 0.3748151183901361 0.3760338998362696 0.3829150808161275 0.3841602009158513 0.3906373023990221 0.3919075328521676 0.3983652317385465 0.3996605911050301
0.406480133489536 0.4078018800878236 0.4145992363495962 0.4159473838404371 0.4227235238201337 0.4240980890623294 0.4304686564547328 0.4318684065502333 0.4382164439562757
0.4396413875379139 0.4463489290384909 0.4478003170276637 0.4544823491094193 0.4559601845464303 0.4626166004905004 0.4641208860785213 0.470751784887656 0.4722825236605759
0.4785036764886068 0.4800596220929673 0.486633503837215 0.4882158852069559 0.4943709597308301 0.4959785009914117 0.502479159396033 0.5041130660952415 0.5105726294674962
0.512232853709101 0.5186483892971976 0.5203348734927932 0.5267087790327916 0.5284214732034318 0.5344904142923997 0.5362284120119565 0.5421342182310729 0.5438970713133418
0.5502033260482438 0.5519924174541494 0.5583120642198542 0.5601275228154484 0.5665206241752909 0.5683627745511391 0.5742736086012711 0.5761409693620999 0.5819524448520371
0.5838447748901722 0.5899961210140513 0.591914606679692 0.5981367389758905 0.6000816954947563 0.6062612328823314 0.6082326078238199 0.6139891743550618 0.6159856782493418
0.6217020223331746 0.623723606100719 0.6295913193586837 0.6316385567589856 0.6377653030384736 0.6398391197873293 0.6458190701143912 0.6479190753033844 0.6541566170946882
0.6562837334911363 0.6618008400206912 0.6639528131422728 0.6699223065860094 0.6721006882862063 0.6775449581602477 0.6797481264419983 0.6856437214610128 0.6878732244971574
0.6935814940177247 0.695836808314546 0.7016366241440788 0.7039181313132697 0.709705856689687 0.7120136025880942 0.7177645246694223 0.7200984749442396 0.7258142875643973
0.7281744132589539 0.7339554983783031 0.7363420968538624 0.7420859180388898 0.7444989542058508 0.7497996761741695 0.7522377951739535 0.7574084721926538 0.7598713327198711
0.7650117024519579 0.7674992864084252 0.7730174533892418 0.7755310696517345 0.7811075108508807 0.7836474335589837 0.7892724115280283 0.7918388840494792 0.7974138106069117
0.8000067565215466 0.8056169748708625 0.8082365950205777 0.8135658669535445 0.816211334521307 0.8213255105466555 0.8239962101530169 0.829242574214828 0.8319390177427586
0.8370829503324179 0.8398048884169548 0.8454152884202761 0.8481643207745085 0.8532523057058028 0.856026821694725 0.8614897782714848 0.8642910800558162 0.8693003110837616
0.8721270103832023 0.8774885682570619 0.8803418933181856 0.8854532218703798 0.8883324456013311 0.8934528695387036 0.8963581057296763 0.9010534532900417 0.9039834043046125
0.9089319065807004 0.9118874759674483 0.9167609857678787 0.9197420129769963 0.9249624084248843 0.9279701042058975 0.9330316439657489 0.9360655784857183 0.9410404196288085
0.9441003962903061 0.9488799412961575 0.9519654097358451 0.9565785237508843 0.9596890256766235 0.9645868244983244 0.9677233670213087 0.9726644785371455 0.9758272871735215
0.9807483303509975 0.9839374252540747 0.9887471809818733 0.9919622857532446 0.996778435740851 1.0 1.0 1.0 1.0)
3)))
:computed-slots
((regression-test-data (multiple-value-list (the approximate b-spline-data))))
:objects ((profile :type 'b-spline-curve
:control-points (first (the sample-b-spline-data))
:weights (second (the sample-b-spline-data))
:knot-vector (third (the sample-b-spline-data))
:degree (fourth (the sample-b-spline-data)))
(approximate :type 'approximated-curve
:tolerance 0.0001
:pinned-parameters (list 0.1 0.5 0.7 0.9)
:match-parameterization? t
:curve-in (the profile))))
(register-test-definition 'approximated-curve-test)
| 18,204 | Common Lisp | .lisp | 129 | 134.341085 | 191 | 0.765306 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 11d6b7aa34c0382c67e73479705eef85a7f5f4301951ca0c2742041e881f3a57 | 35,718 | [
-1
] |
35,719 | projected-curve.lisp | lisp-mirror_gendl/regression/source/projected-curve.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :gdl-lift-tests)
(define-object projected-curve-test (projected-curve)
:computed-slots
((projection-vector (make-vector 0 0 -1))
(regression-test-data (multiple-value-list (the b-spline-data))))
:objects
((surface :type 'test-fitted-surface
:display-controls (list :color :pink)
:length 10 :width 10 :height 5)
(curve-in :type 'b-spline-curve
:display-controls (list :color :grey-light-very)
:control-points (list (make-point 3 5 7)
(make-point 5 8 7)
(make-point 7 10 7)
(make-point 8 5 7)
(make-point 7 0 7)
(make-point 5 0 7)
(make-point 3 5 7)))))
(register-test-definition 'projected-curve-test)
| 1,579 | Common Lisp | .lisp | 39 | 36.589744 | 70 | 0.714003 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 509ac8a064c5a2b7aecca894354b6d6ee94278d274687527aef8ccae7d88d0ab | 35,719 | [
-1
] |
35,720 | glisp.asd | lisp-mirror_gendl/glisp/glisp.asd | ;;;; -*- coding: utf-8 -*-
(asdf:defsystem #:glisp :description
"The Gendl® Common Lisp Portability" :author
"Genworks International" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20181023" :depends-on
(:uiop :bordeaux-threads :cl-ppcre #+sbcl :sb-posix #-allegro :cl-base64 #-allegro :babel :base)
#-asdf-unicode :defsystem-depends-on #-asdf-unicode (:asdf-encodings)
#+asdf-unicode :defsystem-depends-on #+asdf-unicode ()
#+asdf-encodings :encoding #+asdf-encodings :utf-8
:components
((:file "source/parameters") (:file "source/genworks")
(:file "source/initialize") (:file "source/zzinit")))
| 654 | Common Lisp | .lisp | 13 | 48.307692 | 98 | 0.71875 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 82242f725ed18d1babf7ed9c1ed6f5e14dfee2111c4c6f4fd7c887f20d77ff12 | 35,720 | [
-1
] |
35,721 | zzinit.lisp | lisp-mirror_gendl/glisp/source/zzinit.lisp | ;;
;; Copyright 2002-2011, 2012 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :com.genworks.lisp)
(glisp:set-features *these-features*) | 850 | Common Lisp | .lisp | 21 | 39.190476 | 70 | 0.759371 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 7d884fbe7f9cb18045f4f8e26c7830ed1e67e925cd2f187a77a687f6712f997d | 35,721 | [
-1
] |
35,722 | initialize.lisp | lisp-mirror_gendl/glisp/source/initialize.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :com.genworks.lisp)
(defun initialize () (glisp:set-settings *settings*)) | 927 | Common Lisp | .lisp | 22 | 40.909091 | 70 | 0.761062 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9f81a092a6118f0f56575a30122780a01a37960eb12f68535664ca3daa63ce6a | 35,722 | [
-1
] |
35,723 | parameters.lisp | lisp-mirror_gendl/glisp/source/parameters.lisp | ;;
;; Copyright 2002, 2009 Genworks International and Genworks BV
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :com.genworks.lisp)
(defparameter *these-features* (list :glisp))
(defparameter *settings* nil) | 967 | Common Lisp | .lisp | 23 | 40.782609 | 70 | 0.76327 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | d56bd53ab90a29a04829ed54df9f6abe8044c6d0e93c6c7ac97a69327f31f69c | 35,723 | [
-1
] |
35,724 | zzinit.lisp | lisp-mirror_gendl/geom-base/zzinit/source/zzinit.lisp | ;;
;; Copyright 2002-2011, 2012 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(defparameter *these-features* (list :geom-base))
(glisp:set-features *these-features*) | 915 | Common Lisp | .lisp | 22 | 39.272727 | 71 | 0.740991 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 615ca9122fce7c660dd947bbf124b80e9df7a3263459fcd556cc8a634eee7d59 | 35,724 | [
-1
] |
35,725 | initialize.lisp | lisp-mirror_gendl/geom-base/zzinit/source/initialize.lisp | ;;
;; Copyright 2002-2011, 2012 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(defparameter *settings* (list (list 'cl-who:*prologue* cl-who:*prologue* "<!doctype HTML>")
(list 'cl-who:*attribute-quote-char* cl-who:*attribute-quote-char* #\")
(list 'cl-who:*downcase-tokens-p* cl-who:*downcase-tokens-p* nil)
(list 'gdl:*gs-path* gdl:*gs-path* #'(lambda() (glisp:find-gs-path)))))
(defun initialize () (glisp:set-settings *settings*))
| 1,193 | Common Lisp | .lisp | 25 | 45.2 | 92 | 0.718831 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 91bdea598a805e6acff4cb704b2d1d9c1c4676b2972183bba779437c3cf07fe9 | 35,725 | [
-1
] |
35,726 | pie-chart.lisp | lisp-mirror_gendl/geom-base/graphs/source/pie-chart.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object pie-chart (base-object)
:documentation (:description "Generates a standard Pie Chart with colored filled pie sections.
This object was inspired by the pie-chart in Marc Battyani's (marc.battyani(at)fractalconcept.com)
cl-pdf, with contributions from Carlos Ungil (Carlos.Ungil(at)cern.ch)."
:examples "
<pre>
(in-package :gdl-user)
(define-object pie-sample (pie-chart)
:computed-slots
((data (list 30 70))
(labels&colors '((\"Expenses\" :red) (\"Revenue\" :green)))
(width 200)
(title \"Cash Flow\")))
(generate-sample-drawing :objects (make-object 'pie-sample))
</pre>")
:input-slots
(("String. Currently this must be a PDF font name. Defaults to \"Helvetica.\""
title-font "Helvetica")
("List of Numbers. The relative size for each pie piece. These will be normalized to percentages.
Defaults to NIL, must be specified as non-NIL to get a result."
data nil)
("List of lists, each containing a string and a keyword symbol. This list should be the same
length as <tt>data</tt>. These colors and labels will be assigned to each pie piece and to the legend.
Defaults to NIL, must be specified as non-NIL to get a result."
labels&colors nil)
("Number. The radius of the pie. Defaults to 0.35 times the <tt>width</tt>."
radius (half (* (the width) 0.7)))
(background-color :white)
("String. Title for the chart. Defaults to the empty string."
title "")
("Number. Size in points of title font. Defaults to 12."
title-font-size 12)
("Keyword symbol naming color from <tt>*color-table*</tt>.
Color of title text. Defaults to :black."
title-color :black)
("Keyword symbol naming color from <tt>*color-table*</tt>.
Color of the outline of the pie. Defaults to :black."
line-color :black)
("Boolean. Determines whether the Legend is included in standard output formats. Defaults to <tt>t</tt>."
include-legend? t)
(title-width (twice (the radius))))
:computed-slots
((data-sum (apply #'+ (the data)))
(start-point (translate (the center) :right (the radius)))
(%vertex-array% (append (coerce (the title-block %vertex-array%) 'list)
(when (the include-legend?) (coerce (the legend boundary :%vertex-array%) 'list))
(list (translate (the center) :left (the radius) :rear (the radius))
(translate (the center) :right (the radius) :rear (the radius))
(translate (the center) :left (the radius) :front (the radius))
(translate (the center) :right (the radius) :front (the radius))))))
:hidden-objects
((title-block :type (if (string-equal (the title) "") 'null-part 'general-note)
:strings (the title) :font (the title-font)
:character-size (the title-font-size)
:center (translate (the center)
:rear (+ (the radius) (the-child leading))
;;:left (half (the-child width))
))
(legend :type 'legend
:upper-left (translate (the center) :right (* (the radius) 1.1) :rear (the radius))
:pass-down (labels&colors))
(pie-pieces :type 'pie-piece
:pseudo-inputs (fraction line-color)
:sequence (:size (length (the data)))
:datum (nth (the-child index) (the data))
:label (first (nth (the-child :index) (the labels&colors)))
:display-controls (list :color (second (nth (the-child :index) (the labels&colors))))
:start-angle (if (the-child first?) 0 (the-child previous end-angle))
:angle (* 2pi (the-child fraction))
:fraction (/ (the-child datum) (the data-sum))
:pass-down (radius start-point line-color))))
(define-lens (pdf pie-chart)()
:output-functions
((cad-output
()
(when (or (not (numberp (the radius))) (zerop (the radius)))
(error "Pie Chart must have nonzero radius."))
(write-the title-block (cad-output))
(when (the include-legend?) (write-the legend (cad-output)))
(mapc #'(lambda(pie-piece) (write-the-object pie-piece cad-output)) (list-elements (the pie-pieces))))))
(define-object pie-piece (base-object)
:input-slots
(datum label color start-angle angle percentage radius start-point)
:computed-slots
((end-angle (+ (the start-angle) (the angle))))
:hidden-objects ((arc :type 'arc
:pass-down (start-angle end-angle radius))))
;;
;; FLAG -- remove this and handle in base-view output of generic
;; curves (if possible). Or, do only the fill part here.
(define-lens (pdf pie-piece)()
:output-functions
((cad-output
()
(with-format-slots (view)
(let ((center (if view (the-object view (view-point (the center))) (the center)))
(curves (if view (mapcar #'(lambda(curve)
(mapcar #'(lambda(point) (the-object view (view-point point))) curve))
(the arc %curves-to-draw%)) (the arc %curves-to-draw%))))
(write-the line-thickness-setting)
(write-the rgb-stroke-setting)
(apply #'pdf:set-rgb-fill (coerce (lookup-color (the color-decimal) :ground :background) 'list))
(pdf:move-to (get-x center) (get-y center))
(pdf:line-to (get-x (first (first curves))) (get-y (first (first curves))))
(mapc #'(lambda(curve) (apply #'pdf:bezier-to
(mapcan #'(lambda(point) (list (get-x point) (get-y point)))
(rest curve)))) curves)
(pdf:line-to (get-x center) (get-y center))
(pdf:fill-and-stroke))))))
| 6,964 | Common Lisp | .lisp | 130 | 43.246154 | 112 | 0.615788 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | c6786995d59b8d0c5788c03aa23dae6566d6297b6231ed21f80019ed0570c24d | 35,726 | [
-1
] |
35,727 | graph.lisp | lisp-mirror_gendl/geom-base/graphs/source/graph.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object graph (base-object)
:input-slots
(x-values y-values (colors (list :red :orange :yellow :green :indigo :violet)))
:computed-slots
((min-x (apply #'min (flatten (the :x-values))))
(max-x (apply #'max (flatten (the :x-values))))
(x-range (- (the :max-x) (the :min-x)))
(min-y (apply #'min (flatten (the :y-values))))
(max-y (apply #'max (flatten (the :y-values))))
(y-range (- (the :max-y) (the :min-y))))
:objects
((x-axis :type 'line
:start (make-point (- (the :min-x) (* (the :x-range) 0.05)) 0 0)
:end (make-point (+ (the :max-x) (* (the :x-range) 0.05)) 0 0))
(y-axis :type 'line
:start (make-point 0 (- (the :min-y) (* (the :y-range) 0.05)) 0)
:end (make-point 0 (+ (the :max-y) (* (the :y-range) 0.05)) 0))
(value-lines :type 'global-polyline
:sequence (:size (length (the :x-values)))
:display-controls (list :color (nth (the-child :index) (the :colors))
:line-thickness 5)
:vertex-list (mapcar #'(lambda(x y)
(make-point x y 0))
(nth (the-child :index) (the :x-values))
(nth (the-child :index) (the :y-values))))))
(define-object test-graph (graph)
:computed-slots
((x-values (list (list 25 35 70 108 125)))
(y-values (list (list 3 5 7 9 12)))))
| 2,420 | Common Lisp | .lisp | 50 | 39.58 | 86 | 0.58897 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 6ea422c282e77c3cb13f17b02b534490af8b73a73cad3e7d4e834ea2afb40d51 | 35,727 | [
-1
] |
35,728 | legend.lisp | lisp-mirror_gendl/geom-base/graphs/source/legend.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object legend (base-object)
:input-slots (upper-left labels&colors
(background-color :white) (label-font "Helvetica")
(label-font-size 10) (label-color :black)
(leading 1.2))
:computed-slots
((width (+ (max-of-elements (the labels) (the-element width))
(the (color-keys 0) width)
(* (the key-spacing) 3)))
(length (- (* (the leading) (the color-key-size)
(1+ (length (the labels&colors))))
(the color-key-size)))
(height 0)
(center (translate (the upper-left) :front (half (the length))
:right (half (the width))))
(color-key-size (* (the label-font-size) 1.5))
(key-spacing (* (1- (the leading)) (the color-key-size))))
:hidden-objects
((boundary :type 'box)
(color-keys :type 'filled-rectangle
:sequence (:size (length (the labels&colors)))
:width (the color-key-size)
:length (the color-key-size)
:display-controls (list :color (second (nth (the-child index) (the labels&colors))))
:center (translate (the upper-left)
:right (+ (half (the-child width)) (the key-spacing))
:front (+ (half (the-child length)) (the key-spacing)
(* (the-child index) (the-child length) (the leading)))))
(labels :type 'general-note
:sequence (:size (length (the labels&colors)))
:font (the label-font)
:character-size (the label-font-size)
:strings (first (nth (the-child index) (the labels&colors)))
:start (translate (the (color-keys (the-child index)) (edge-center :right :top))
:right (the key-spacing)))))
(define-object filled-rectangle (base-object))
;;
;; FLAG -- update for auto-scaling outside base-view
;;
(define-lens (pdf filled-rectangle)()
:output-functions
((cad-output
()
(with-format-slots (view)
(let ((corners (list (the (vertex :rear :left :top))
(the (vertex :rear :right :top))
(the (vertex :front :right :top))
(the (vertex :front :left :top)))))
(destructuring-bind (p0 p1 p2 p3)
(if view (mapcar #'(lambda(point)(the-object view (view-point point))) corners) corners)
(pdf:with-saved-state
(write-the line-thickness-setting)
(write-the rgb-stroke-setting)
(apply #'pdf:set-rgb-fill (coerce (lookup-color (the color-decimal) :ground :background) 'list))
(pdf:move-to (get-x p1) (get-y p1))
(pdf:line-to (get-x p2) (get-y p2))
(pdf:line-to (get-x p3) (get-y p3))
(pdf:line-to (get-x p0) (get-y p0))
(pdf:fill-and-stroke))))))))
(define-lens (pdf legend)()
:output-functions
((cad-output
()
(write-the boundary (cad-output))
(mapc #'(lambda(label) (write-the-object label (cad-output))) (list-elements (the labels)))
(mapc #'(lambda(color-key) (write-the-object color-key (cad-output))) (list-elements (the color-keys))))))
| 4,270 | Common Lisp | .lisp | 87 | 38.068966 | 111 | 0.584966 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 5758ac8691c5e87bd36477aea63f164bbbedce6b15ae16121261f34a61b0a85f | 35,728 | [
-1
] |
35,729 | pdf-raw.lisp | lisp-mirror_gendl/geom-base/formats/source/pdf-raw.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-format pdf-raw (pdf))
| 920 | Common Lisp | .lisp | 22 | 39.454545 | 71 | 0.741611 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | dd368ee9b7e3b08a9cbd793107ad8afe59c80e1a22dbe16db90370cb1d2828da | 35,729 | [
-1
] |
35,730 | obj.lisp | lisp-mirror_gendl/geom-base/formats/source/obj.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-format obj (base-format))
| 926 | Common Lisp | .lisp | 22 | 39.636364 | 71 | 0.742762 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9f086dad2ca84fc1ea072de56a71a7f830ee19c59c6dcd1be2fe0da89c6d8424 | 35,730 | [
-1
] |
35,731 | macro-redefs.lisp | lisp-mirror_gendl/geom-base/formats/source/macro-redefs.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
#+nil
(defmacro with-format ((format stream-or-file &rest args) &body body)
"Void [Macro]. Used to establish an output format and a stream to which data is to be sent. This
supports a full range of output options such as page dimensions, view transforms, view scales, etc.
:example
<pre>
(gdl::with-format (pdf \"/tmp/box.pdf\" :view-transform (getf *standard-views* :trimetric))
(write-the-object (make-instance 'box :length 100 :width 100 :height 100) cad-output))
</pre>"
(let ((flag (gensym)))
(let ((external-format (getf args :external-format))
(args (remove-plist-keys args (list :external-format))))
`(let ((*%format%* (make-instance ',format ,@args)))
(let ((*stream* (if (or (stringp ,stream-or-file) (pathnamep ,stream-or-file))
(open ,stream-or-file :if-does-not-exist :create
:if-exists :supersede :direction :output
:external-format ,(or external-format :default)
#+nil ,(or external-format
#+mswindows
(excl:crlf-base-ef :1252)
#-mswindows
:default))
,stream-or-file))
(,flag t))
(unwind-protect
(progn (multiple-value-prog1
,(case format
(pdf `(pdf:with-document()
(pdf:with-page (:bounds (make-array 4 :initial-contents
(list 0 0 (format-slot page-width)
(format-slot page-length))))
(with-format-slots (page-width page-length background-color)
(setq background-color (coerce (lookup-color background-color
:ground :background) 'list))
(pdf:with-saved-state
(apply #'pdf:set-rgb-stroke (coerce background-color 'list))
(apply #'pdf:set-rgb-fill (coerce background-color 'list))
(pdf:move-to 0 0)
(pdf:line-to page-width 0)
(pdf:line-to page-width page-length) (pdf:line-to 0 page-length)
(pdf:line-to 0 0) (pdf:fill-and-stroke)))
(with-format-slots (page-width page-length)
(pdf:translate (half page-width) (half page-length)))
,@body)
(when *stream* (pdf:write-document *stream*))))
(pdf-multipage `(pdf:with-document() ,@body (when *stream* (pdf:write-document *stream*))))
;;
;; FLAG -- consider having default
;; initialize-output and finalize-output
;; methods instead of these special
;; cases. Special case is only really
;; needed when we need to wrap things like
;; in PDF.
;;
(dxf `(progn (write-string *dxf-header* *stream*)
,@body
(write-string *dxf-footer* *stream*)))
(otherwise `(progn (write-env (:initialize-output) )
,@body
(write-env (:finalize-output)))))
(setq ,flag nil)))
(when (and (or (stringp ,stream-or-file) (pathnamep ,stream-or-file)) (streamp *stream*))
(close *stream* :abort ,flag))) nil)))))
(defmacro with-format ((format stream-or-file &rest args) &body body)
"Void [Macro]. Used to establish an output format and a stream to which data is to be sent. This
supports a full range of output options such as page dimensions, view transforms, view scales, etc.
:example
<pre>
(gdl::with-format (pdf \"/tmp/box.pdf\" :view-transform (getf *standard-views* :trimetric))
(write-the-object (make-instance 'box :length 100 :width 100 :height 100) cad-output))
</pre>"
(let ((flag (gensym)))
(let (;;(external-format (getf args :external-format))
;;(element-type (getf args :element-type))
(args (remove-plist-keys args (list :external-format))))
`(let ((*%format%* (make-instance ',format ,@args))
(file? (or (stringp ,stream-or-file) (pathnamep ,stream-or-file))))
(let ((*stream* (if file?
(open ,stream-or-file
:if-does-not-exist (or (format-slot if-does-not-exist) :create)
:if-exists (or (format-slot if-exists) :error)
:direction (or (format-slot direction) :output)
:external-format (format-slot external-format)
:element-type (format-slot element-type)
;; FLAG -- below element-type seems necessary for generate-sample-drawing
;; from an aserve thread on CCL (at least). Make this as a passable
;; arg for with-format png and other known binary types.
;;:element-type '(unsigned-byte 8)
;;:external-format ,(or external-format :default)
)
,stream-or-file))
(,flag t))
(unwind-protect
(progn (multiple-value-prog1
,(case format
(pdf `(let ((path (glisp:temporary-file)))
(pdf:with-document()
(pdf:with-page (:bounds (make-array 4 :initial-contents
(list 0 0 (format-slot page-width)
(format-slot page-length))))
(with-format-slots (page-width page-length background-color)
(setq background-color (coerce (lookup-color background-color
:ground :background) 'list))
(pdf:with-saved-state
(apply #'pdf:set-rgb-stroke (coerce background-color 'list))
(apply #'pdf:set-rgb-fill (coerce background-color 'list))
(pdf:move-to 0 0)
(pdf:line-to page-width 0)
(pdf:line-to page-width page-length) (pdf:line-to 0 page-length)
(pdf:line-to 0 0) (pdf:fill-and-stroke)))
(with-format-slots (page-width page-length)
(pdf:translate (half page-width) (half page-length)))
,@body)
(pdf:write-document (if file? ,stream-or-file path)))
(when (and *stream* (not file?))
(with-open-file (in path
:element-type '(unsigned-byte 8))
(do ((val (read-byte in nil nil) (read-byte in nil nil)))
((null val))
(write-byte val *stream*))))
(when (probe-file path) (delete-file path))))
;;
;; FLAG -- update multipage to match pdf case behavior
;;
(pdf-multipage `(let ((path (glisp:temporary-file)))
(pdf:with-document() ,@body
(pdf:write-document (if file? ,stream-or-file path)))
(when (and *stream* (not file?))
(with-open-file (in path :element-type '(unsigned-byte 8))
(do ((val (read-byte in nil nil) (read-byte in nil nil)))
((null val))
(write-byte val *stream*))))
(when (probe-file path) (delete-file path))))
#+nil
(pdf-multipage `(pdf:with-document() ,@body
(when *stream* (pdf:write-document *stream*))))
;;
;; FLAG -- consider having default
;; initialize-output and finalize-output
;; methods instead of these special
;; cases. Special case is only really
;; needed when we need to wrap things like
;; in PDF.
;;
(dxf `(progn (write-string *dxf-header* *stream*)
,@body
(write-string *dxf-footer* *stream*)))
(otherwise `(progn (write-env (:initialize-output) )
,@body
(write-env (:finalize-output)))))
(setq ,flag nil)))
(when (and (or (stringp ,stream-or-file) (pathnamep ,stream-or-file)) (streamp *stream*))
(close *stream* :abort ,flag))) nil)))))
| 8,834 | Common Lisp | .lisp | 174 | 38.367816 | 103 | 0.569211 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | e5d3ae725b64f64fae4ab1bc1b4e4ac1fab3a73a153179c8aaf5807a96442da9 | 35,731 | [
-1
] |
35,732 | pdf-multipage.lisp | lisp-mirror_gendl/geom-base/formats/source/pdf-multipage.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-format pdf-multipage (pdf))
| 930 | Common Lisp | .lisp | 22 | 39.727273 | 71 | 0.743333 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | d84531ae786a1f735da8b135453c98737c7fd899129755cd48f33b6df7ba2af4 | 35,732 | [
-1
] |
35,733 | raster.lisp | lisp-mirror_gendl/geom-base/formats/source/raster.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-format raster (2d-output))
(define-format png (raster)
:documentation (:author "David J Cooper Jr [Genworks]"
:description "PNG is Portable Network Graphics. Using PNG you can produce wireframe
renderings for geometric objects and text output with specified fonts and sizes"))
(define-format jpeg (raster)
:documentation (:author "David J Cooper Jr [Genworks]"
:description "JPEG is a lossy format. Using JPEG you can produce wireframe
renderings for geometric objects and text output with specified fonts and sizes"))
| 1,471 | Common Lisp | .lisp | 30 | 45.233333 | 102 | 0.739343 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 333cddb651d9a98144079534f32eb2099e8656fcaeb783faf44174b403657c70 | 35,733 | [
-1
] |
35,734 | dxf.lisp | lisp-mirror_gendl/geom-base/formats/source/dxf.lisp | ;;
;; Copyright 2013 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(defparameter *dxf-header-new*
" 0
SECTION
2
HEADER
9
$ACADVER
1
AC1015
9
$HANDSEED
5
FFFF
9
$DIMADEC
70
0
9
$DIMASZ
40
0.18
9
$DIMAUNIT
70
0
9
$DIMAZIN
70
0
9
$DIMDEC
70
4
9
$DIMDSEP
70
46
9
$DIMEXE
40
0.18
9
$DIMEXO
40
0.0625
9
$DIMGAP
40
0.09
9
$DIMLUNIT
70
2
9
$DIMSCALE
40
1.0
9
$DIMTSZ
40
0.0
9
$DIMTXT
40
0.18
9
$DIMZIN
70
0
9
$DWGCODEPAGE
3
ANSI_1252
9
$INSUNITS
70
0
9
$LTSCALE
40
1.0
9
$MAXACTVP
70
32
9
$MEASUREMENT
70
0
9
$PDMODE
70
0
9
$PDSIZE
40
0
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
VPORT
5
8
100
AcDbSymbolTable
70
1
0
VPORT
5
30
100
AcDbSymbolTableRecord
100
AcDbViewportTableRecord
2
*Active
70
0
10
0.0
20
0.0
11
1.0
21
1.0
12
286.3055555555554861
22
148.5
13
0.0
23
0.0
14
10.0
24
10.0
15
10.0
25
10.0
16
0.0
26
0.0
36
1.0
17
0.0
27
0.0
37
0.0
40
297.0
41
1.92798353909465
42
50.0
43
0.0
44
0.0
50
0.0
51
0.0
71
0
72
100
73
1
74
3
75
1
76
1
77
0
78
0
281
0
65
1
110
0.0
120
0.0
130
0.0
111
1.0
121
0.0
131
0.0
112
0.0
122
1.0
132
0.0
79
0
146
0.0
0
ENDTAB
0
TABLE
2
LTYPE
5
5
100
AcDbSymbolTable
70
50
0
LTYPE
5
16
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
Continuous
70
0
3
Solid line
72
65
73
0
40
0.0
0
LTYPE
5
15
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BYLAYER
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
31
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO15W100
70
0
3
ISO double-dash triple-dot __ __ . . . __ __ . .
72
65
73
10
40
39.0
49
12.0
74
0
49
-3.0
74
0
49
12.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
32
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CENTER2
70
0
3
Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
72
65
73
4
40
28.5750000000000028
49
19.0500000000000007
74
0
49
-3.1749999999999998
74
0
49
3.1749999999999998
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
33
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO07W100
70
0
3
ISO dot . . . . . . . . . . . . . . . . . . . .
72
65
73
2
40
3.0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
34
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BORDERX2
70
0
3
Border (2x) ____ ____ . ____ ____ . ___
72
65
73
6
40
88.8999999999999915
49
25.3999999999999986
74
0
49
-12.6999999999999993
74
0
49
25.3999999999999986
74
0
49
-12.6999999999999993
74
0
49
0.0
74
0
49
-12.6999999999999993
74
0
0
LTYPE
5
35
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO14W100
70
0
3
ISO dash triple-dot __ . . . __ . . . __ . . . _
72
65
73
8
40
24.0
49
12.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
36
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO06W100
70
0
3
ISO long-dash triple-dot ____ ... ____ ... ____
72
65
73
8
40
36.0
49
24.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
37
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
PHANTOM2
70
0
3
Phantom (.5x) ___ _ _ ___ _ _ ___ _ _ ___ _ _
72
65
73
6
40
31.7500000000000036
49
15.875
74
0
49
-3.1749999999999998
74
0
49
3.1749999999999998
74
0
49
-3.1749999999999998
74
0
49
3.1749999999999998
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
38
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO13W100
70
0
3
ISO double-dash double-dot __ __ . . __ __ . . _
72
65
73
8
40
36.0
49
12.0
74
0
49
-3.0
74
0
49
12.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
39
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO05W100
70
0
3
ISO long-dash double-dot ____ .. ____ .. ____ .
72
65
73
6
40
33.0
49
24.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
3A
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHDOTX2
70
0
3
Dash dot (2x) ____ . ____ . ____ . ___
72
65
73
4
40
50.7999999999999972
49
25.3999999999999986
74
0
49
-12.6999999999999993
74
0
49
0.0
74
0
49
-12.6999999999999993
74
0
0
LTYPE
5
3B
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
HIDDENX2
70
0
3
Hidden (2x) ____ ____ ____ ____ ____ ____ ____
72
65
73
2
40
19.0499999999999972
49
12.6999999999999993
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
3C
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
PHANTOM
70
0
3
Phantom ______ __ __ ______ __ __ ______
72
65
73
6
40
63.5000000000000071
49
31.75
74
0
49
-6.3499999999999996
74
0
49
6.3499999999999996
74
0
49
-6.3499999999999996
74
0
49
6.3499999999999996
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
3D
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
FENCELINE1
70
0
3
Fenceline circle ----0-----0----0-----0----0-----0--
72
65
73
4
40
36.8299999999999983
49
6.3499999999999996
74
0
49
-2.54
74
0
49
-2.54
74
0
49
25.3999999999999986
74
0
0
LTYPE
5
3E
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
FENCELINE2
70
0
3
Fenceline square ----[]-----[]----[]-----[]----[]---
72
65
73
4
40
36.8299999999999983
49
6.3499999999999996
74
0
49
-2.54
74
0
49
-2.54
74
0
49
25.3999999999999986
74
0
0
LTYPE
5
3F
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHEDX2
70
0
3
Dashed (2x) ____ ____ ____ ____ ____ ___
72
65
73
2
40
38.0999999999999943
49
25.3999999999999986
74
0
49
-12.6999999999999993
74
0
0
LTYPE
5
40
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO12W100
70
0
3
ISO dash double-dot __ . . __ . . __ . . __ . .
72
65
73
6
40
21.0
49
12.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
41
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CENTER
70
0
3
Center ____ _ ____ _ ____ _ ____ _ ____ _ ____
72
65
73
4
40
50.8000000000000043
49
31.75
74
0
49
-6.3499999999999996
74
0
49
6.3499999999999996
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
42
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DRAINAGE
70
0
3
Drainage ---->---->---->----
72
65
73
2
40
10.1600000000000001
49
5.0800000000000001
74
0
49
5.0800000000000001
74
0
0
LTYPE
5
43
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO04W100
70
0
3
ISO long-dash dot ____ . ____ . ____ . ____ . _
72
65
73
4
40
30.0
49
24.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
44
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BORDER2
70
0
3
Border (.5x) __.__.__.__.__.__.__.__.__.__.__.
72
65
73
6
40
22.2249999999999979
49
6.3499999999999996
74
0
49
-3.1749999999999998
74
0
49
6.3499999999999996
74
0
49
-3.1749999999999998
74
0
49
0.0
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
45
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DIVIDE
70
0
3
Divide ____ . . ____ . . ____ . . ____ . . ____
72
65
73
6
40
31.75
49
12.6999999999999993
74
0
49
-6.3499999999999996
74
0
49
0.0
74
0
49
-6.3499999999999996
74
0
49
0.0
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
46
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHED2
70
0
3
Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
72
65
73
2
40
9.5249999999999986
49
6.3499999999999996
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
47
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHED
70
0
3
Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _
72
65
73
2
40
19.0499999999999972
49
12.6999999999999993
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
48
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
PHANTOMX2
70
0
3
Phantom (2x) ____________ ____ ____ _
72
65
73
6
40
127.0000000000000142
49
63.5
74
0
49
-12.6999999999999993
74
0
49
12.6999999999999993
74
0
49
-12.6999999999999993
74
0
49
12.6999999999999993
74
0
49
-12.6999999999999993
74
0
0
LTYPE
5
49
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO11W100
70
0
3
ISO double-dash dot __ __ . __ __ . __ __ . __ _
72
65
73
6
40
33.0
49
12.0
74
0
49
-3.0
74
0
49
12.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
4A
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO03W100
70
0
3
ISO dash space __ __ __ __ __ __
72
65
73
2
40
30.0
49
12.0
74
0
49
-18.0
74
0
0
LTYPE
5
4B
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
HIDDEN2
70
0
3
Hidden (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
72
65
73
2
40
4.7624999999999993
49
3.1749999999999998
74
0
49
-1.5874999999999999
74
0
0
LTYPE
5
4C
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DIVIDEX2
70
0
3
Divide (2x) ________ . . ________ . . _
72
65
73
6
40
63.5
49
25.3999999999999986
74
0
49
-12.6999999999999993
74
0
49
0.0
74
0
49
-12.6999999999999993
74
0
49
0.0
74
0
49
-12.6999999999999993
74
0
0
LTYPE
5
4D
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
TRACKS
70
0
3
Tracks -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
72
65
73
2
40
7.6200000000000001
49
3.8100000000000001
74
0
49
3.8100000000000001
74
0
0
LTYPE
5
4E
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
HOT_WATER_SUPPLY
70
0
3
Hot water supply ---- HW ---- HW ---- HW ----
72
65
73
3
40
22.8599999999999994
49
12.6999999999999993
74
0
49
-5.0800000000000001
74
0
49
-5.0800000000000001
74
0
0
LTYPE
5
4F
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO10W100
70
0
3
ISO dash dot __ . __ . __ . __ . __ . __ . __ .
72
65
73
4
40
18.0
49
12.0
74
0
49
-3.0
74
0
49
0.0
74
0
49
-3.0
74
0
0
LTYPE
5
50
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DOTX2
70
0
3
Dot (2x) . . . . . . . . . . . . . .
72
65
73
2
40
12.6999999999999993
49
0.0
74
0
49
-12.6999999999999993
74
0
0
LTYPE
5
51
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO02W100
70
0
3
ISO dash __ __ __ __ __ __ __ __ __ __ __ __ __
72
65
73
2
40
15.0
49
12.0
74
0
49
-3.0
74
0
0
LTYPE
5
52
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BATTING
70
0
3
Batting SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
72
65
73
4
40
10.1625399999999999
49
0.00254
74
0
49
-2.54
74
0
49
-5.0800000000000001
74
0
49
-2.54
74
0
0
LTYPE
5
53
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BORDER
70
0
3
Border __ __ . __ __ . __ __ . __ __ . __ __ .
72
65
73
6
40
44.4499999999999957
49
12.6999999999999993
74
0
49
-6.3499999999999996
74
0
49
12.6999999999999993
74
0
49
-6.3499999999999996
74
0
49
0.0
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
54
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHDOT2
70
0
3
Dash dot (.5x) _._._._._._._._._._._._._._._.
72
65
73
4
40
12.6999999999999993
49
6.3499999999999996
74
0
49
-3.1749999999999998
74
0
49
0.0
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
14
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
BYBLOCK
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
55
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DASHDOT
70
0
3
Dash dot __ . __ . __ . __ . __ . __ . __ . __
72
65
73
4
40
25.3999999999999986
49
12.6999999999999993
74
0
49
-6.3499999999999996
74
0
49
0.0
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
56
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DOT
70
0
3
Dot . . . . . . . . . . . . . . . . . . . . . . . .
72
65
73
2
40
6.3499999999999996
49
0.0
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
57
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
HIDDEN
70
0
3
Hidden __ __ __ __ __ __ __ __ __ __ __ __ __ __
72
65
73
2
40
9.5249999999999986
49
6.3499999999999996
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
58
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO09W100
70
0
3
ISO long-dash double-short-dash ____ __ __ ____
72
65
73
6
40
45.0
49
24.0
74
0
49
-3.0
74
0
49
6.0
74
0
49
-3.0
74
0
49
6.0
74
0
49
-3.0
74
0
0
LTYPE
5
59
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DRAINAGE2
70
0
3
Drainage reversed----<----<----<----
72
65
73
2
40
10.1600000000000001
49
5.0800000000000001
74
0
49
5.0800000000000001
74
0
0
LTYPE
5
5A
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
CENTERX2
70
0
3
Center (2x) ________ __ ________ __ _____
72
65
73
4
40
101.6000000000000085
49
63.5
74
0
49
-12.6999999999999993
74
0
49
12.6999999999999993
74
0
49
-12.6999999999999993
74
0
0
LTYPE
5
5B
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DIVIDE2
70
0
3
Divide (.5x) __..__..__..__..__..__..__..__.._
72
65
73
6
40
15.875
49
6.3499999999999996
74
0
49
-3.1749999999999998
74
0
49
0.0
74
0
49
-3.1749999999999998
74
0
49
0.0
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
5C
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ACAD_ISO08W100
70
0
3
ISO long-dash short-dash ____ __ ____ __ ____ _
72
65
73
4
40
36.0
49
24.0
74
0
49
-3.0
74
0
49
6.0
74
0
49
-3.0
74
0
0
LTYPE
5
5D
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
GAS_LINE
70
0
3
Gas line ----GAS----GAS----GAS----GAS----GAS----GAS--
72
65
73
3
40
24.1300000000000026
49
12.6999999999999993
74
0
49
-5.0800000000000001
74
0
49
-6.3499999999999996
74
0
0
LTYPE
5
5E
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
DOT2
70
0
3
Dot (.5x) ........................................
72
65
73
2
40
3.1749999999999998
49
0.0
74
0
49
-3.1749999999999998
74
0
0
LTYPE
5
5F
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ZIGZAG
70
0
3
Zig zag /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
72
65
73
4
40
20.32254
49
0.00254
74
0
49
-5.0800000000000001
74
0
49
-10.1600000000000001
74
0
49
-5.0800000000000001
74
0
0
ENDTAB
0
TABLE
2
LAYER
5
2
100
AcDbSymbolTable
70
2
0
LAYER
5
60
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
Main
70
0
62
0
6
BYLAYER
370
5
390
F
0
LAYER
5
10
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
0
70
0
62
7
420
16777215
6
Continuous
370
25
390
F
0
ENDTAB
0
TABLE
2
STYLE
5
3
100
AcDbSymbolTable
70
4
0
STYLE
5
61
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
Standard
70
0
40
0.0
41
1.0
50
0.0
71
0
42
2.5
3
4
1001
ACAD
1000
txt
1071
0
0
STYLE
5
62
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
textstyle0
70
0
40
0.0
41
1.0
50
0.0
71
0
42
12.0
3
4
1001
ACAD
1000
textstyle2
1071
0
0
STYLE
5
63
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
textstyle1
70
0
40
0.0
41
1.0
50
0.0
71
0
42
12.0
3
4
1001
ACAD
1000
textstyle1
1071
0
0
STYLE
5
64
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
textstyle2
70
0
40
0.0
41
1.0
50
0.0
71
0
42
20.0
3
4
1001
ACAD
1000
textstyle4
1071
0
0
ENDTAB
0
TABLE
2
VIEW
5
6
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
UCS
5
7
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
APPID
5
9
100
AcDbSymbolTable
70
1
0
APPID
5
12
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD
70
0
0
APPID
5
65
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
QCAD
70
0
0
ENDTAB
0
TABLE
2
DIMSTYLE
5
A
100
AcDbSymbolTable
70
1
100
AcDbDimStyleTable
71
0
0
DIMSTYLE
105
27
100
AcDbSymbolTableRecord
100
AcDbDimStyleTableRecord
2
Standard
41
0.18
42
0.0625
43
3.75
44
0.18
70
0
73
0
74
0
77
1
78
8
140
0.18
141
2.5
143
0.03937007874016
147
0.09
171
3
172
1
271
2
272
2
274
3
278
44
283
0
284
8
340
61
0
ENDTAB
0
TABLE
2
BLOCK_RECORD
5
1
100
AcDbSymbolTable
70
1
0
BLOCK_RECORD
5
1F
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*Model_Space
340
22
0
BLOCK_RECORD
5
1B
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*Paper_Space
340
1E
0
BLOCK_RECORD
5
23
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*Paper_Space0
340
26
0
ENDTAB
0
ENDSEC
0
SECTION
2
BLOCKS
0
BLOCK
5
20
100
AcDbEntity
8
0
100
AcDbBlockBegin
2
*Model_Space
70
0
10
0.0
20
0.0
30
0.0
3
*Model_Space
1
0
ENDBLK
5
21
100
AcDbEntity
8
0
100
AcDbBlockEnd
0
BLOCK
5
1C
100
AcDbEntity
67
1
8
0
100
AcDbBlockBegin
2
*Paper_Space
70
0
10
0.0
20
0.0
30
0.0
3
*Paper_Space
1
0
ENDBLK
5
1D
100
AcDbEntity
67
1
8
0
100
AcDbBlockEnd
0
BLOCK
5
24
100
AcDbEntity
8
0
100
AcDbBlockBegin
2
*Paper_Space0
70
0
10
0.0
20
0.0
30
0.0
3
*Paper_Space0
1
0
ENDBLK
5
25
100
AcDbEntity
8
0
100
AcDbBlockEnd
0
ENDSEC
0
SECTION
2
ENTITIES
")
(defparameter *dxf-header* *dxf-header-new*)
(defparameter *dxf-footer-new*
" 0
ENDSEC
0
SECTION
2
OBJECTS
0
DICTIONARY
5
C
100
AcDbDictionary
280
0
281
1
3
ACAD_GROUP
350
D
3
ACAD_LAYOUT
350
1A
3
ACAD_MLINESTYLE
350
17
3
ACAD_PLOTSETTINGS
350
19
3
ACAD_PLOTSTYLENAME
350
E
3
AcDbVariableDictionary
350
9B
3
QCAD_OBJECTS
350
9C
0
DICTIONARY
5
D
100
AcDbDictionary
280
0
281
1
0
ACDBDICTIONARYWDFLT
5
E
100
AcDbDictionary
281
1
3
Normal
350
F
100
AcDbDictionaryWithDefault
340
F
0
ACDBPLACEHOLDER
5
F
0
DICTIONARY
5
17
100
AcDbDictionary
280
0
281
1
3
Standard
350
18
0
MLINESTYLE
5
18
100
AcDbMlineStyle
2
STANDARD
70
0
3
62
256
51
90.0
52
90.0
71
2
49
0.5
62
256
6
BYLAYER
49
-0.5
62
256
6
BYLAYER
0
DICTIONARY
5
19
100
AcDbDictionary
280
0
281
1
0
DICTIONARY
5
1A
100
AcDbDictionary
281
1
3
Layout1
350
1E
3
Layout2
350
26
3
Model
350
22
0
LAYOUT
5
1E
100
AcDbPlotSettings
1
2
none_device
4
6
40
0.0
41
0.0
42
0.0
43
0.0
44
0.0
45
0.0
46
0.0
47
0.0
48
0.0
49
0.0
140
0.0
141
0.0
142
1.0
143
1.0
70
688
72
0
73
0
74
5
7
75
16
147
1.0
148
0.0
149
0.0
100
AcDbLayout
1
Layout1
70
1
71
1
10
0.0
20
0.0
11
420.0
21
297.0
12
0.0
22
0.0
32
0.0
14
100000000000000000000.0
24
100000000000000000000.0
34
100000000000000000000.0
15
-100000000000000000000.0
25
-100000000000000000000.0
35
-100000000000000000000.0
146
0.0
13
0.0
23
0.0
33
0.0
16
1.0
26
0.0
36
0.0
17
0.0
27
1.0
37
0.0
76
0
330
1B
0
LAYOUT
5
22
100
AcDbPlotSettings
1
2
none_device
4
6
40
0.0
41
0.0
42
0.0
43
0.0
44
0.0
45
0.0
46
0.0
47
0.0
48
0.0
49
0.0
140
0.0
141
0.0
142
1.0
143
1.0
70
1712
72
0
73
0
74
0
7
75
0
147
1.0
148
0.0
149
0.0
100
AcDbLayout
1
Model
70
1
71
0
10
0.0
20
0.0
11
12.0
21
9.0
12
0.0
22
0.0
32
0.0
14
0.0
24
0.0
34
0.0
15
0.0
25
0.0
35
0.0
146
0.0
13
0.0
23
0.0
33
0.0
16
1.0
26
0.0
36
0.0
17
0.0
27
1.0
37
0.0
76
0
330
1F
0
LAYOUT
5
26
100
AcDbPlotSettings
1
2
none_device
4
6
40
0.0
41
0.0
42
0.0
43
0.0
44
0.0
45
0.0
46
0.0
47
0.0
48
0.0
49
0.0
140
0.0
141
0.0
142
1.0
143
1.0
70
688
72
0
73
0
74
5
7
75
16
147
1.0
148
0.0
149
0.0
100
AcDbLayout
1
Layout2
70
1
71
2
10
0.0
20
0.0
11
12.0
21
9.0
12
0.0
22
0.0
32
0.0
14
0.0
24
0.0
34
0.0
15
0.0
25
0.0
35
0.0
146
0.0
13
0.0
23
0.0
33
0.0
16
1.0
26
0.0
36
0.0
17
0.0
27
1.0
37
0.0
76
0
330
23
0
DICTIONARY
5
9B
100
AcDbDictionary
281
1
3
DIMASSOC
350
9E
3
HIDETEXT
350
9D
0
DICTIONARYVAR
5
9D
100
DictionaryVariables
280
0
1
2
0
DICTIONARYVAR
5
9E
100
DictionaryVariables
280
0
1
1
0
DICTIONARY
5
9C
100
AcDbDictionary
281
1
3
ColorSettings/BackgroundColor
350
9F
3
ColorSettings/ColorMode
350
A0
3
Grid/DisplayGrid00
350
A1
3
Grid/DisplayGrid01
350
A2
3
Grid/DisplayGrid02
350
A3
3
Grid/DisplayGrid03
350
A4
3
Grid/GridSpacingX00
350
A5
3
Grid/GridSpacingX01
350
A6
3
Grid/GridSpacingX02
350
A7
3
Grid/GridSpacingX03
350
A8
3
Grid/GridSpacingY00
350
A9
3
Grid/GridSpacingY01
350
AA
3
Grid/GridSpacingY02
350
AB
3
Grid/GridSpacingY03
350
AC
3
Grid/IsometricGrid00
350
AD
3
Grid/IsometricGrid01
350
AE
3
Grid/IsometricGrid02
350
AF
3
Grid/IsometricGrid03
350
B0
3
Grid/IsometricProjection00
350
B1
3
Grid/IsometricProjection01
350
B2
3
Grid/IsometricProjection02
350
B3
3
Grid/IsometricProjection03
350
B4
3
Grid/MetaGridSpacingX00
350
B5
3
Grid/MetaGridSpacingX01
350
B6
3
Grid/MetaGridSpacingX02
350
B7
3
Grid/MetaGridSpacingX03
350
B8
3
Grid/MetaGridSpacingY00
350
B9
3
Grid/MetaGridSpacingY01
350
BA
3
Grid/MetaGridSpacingY02
350
BB
3
Grid/MetaGridSpacingY03
350
BC
3
MultiPageSettings/Columns
350
BD
3
MultiPageSettings/GlueMarginsBottom
350
BE
3
MultiPageSettings/GlueMarginsLeft
350
BF
3
MultiPageSettings/GlueMarginsRight
350
C0
3
MultiPageSettings/GlueMarginsTop
350
C1
3
MultiPageSettings/PrintCropMarks
350
C2
3
MultiPageSettings/Rows
350
C3
3
PageSettings/OffsetX
350
C4
3
PageSettings/OffsetY
350
C5
3
PageSettings/PageOrientation
350
C6
3
PageSettings/PaperHeight
350
C7
3
PageSettings/PaperWidth
350
C8
3
PageSettings/Scale
350
C9
3
PageSettings/ShowPaperBorders
350
CA
3
UnitSettings/PaperUnit
350
CB
3
ViewportCenter
350
CC
3
ViewportHeight
350
CD
3
ViewportWidth
350
CE
0
XRECORD
5
9F
330
9C
100
AcDbXrecord
280
1
1000
White
0
XRECORD
5
A0
330
9C
100
AcDbXrecord
280
1
1000
FullColor
0
XRECORD
5
A1
330
9C
100
AcDbXrecord
280
1
290
1
0
XRECORD
5
A2
330
9C
100
AcDbXrecord
280
1
290
1
0
XRECORD
5
A3
330
9C
100
AcDbXrecord
280
1
290
1
0
XRECORD
5
A4
330
9C
100
AcDbXrecord
280
1
290
1
0
XRECORD
5
A5
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
A6
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
A7
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
A8
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
A9
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
AA
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
AB
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
AC
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
AD
330
9C
100
AcDbXrecord
280
1
290
0
0
XRECORD
5
AE
330
9C
100
AcDbXrecord
280
1
290
0
0
XRECORD
5
AF
330
9C
100
AcDbXrecord
280
1
290
0
0
XRECORD
5
B0
330
9C
100
AcDbXrecord
280
1
290
0
0
XRECORD
5
B1
330
9C
100
AcDbXrecord
280
1
90
65537
0
XRECORD
5
B2
330
9C
100
AcDbXrecord
280
1
90
65537
0
XRECORD
5
B3
330
9C
100
AcDbXrecord
280
1
90
65537
0
XRECORD
5
B4
330
9C
100
AcDbXrecord
280
1
90
65537
0
XRECORD
5
B5
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
B6
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
B7
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
B8
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
B9
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
BA
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
BB
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
BC
330
9C
100
AcDbXrecord
280
1
1000
auto
0
XRECORD
5
BD
330
9C
100
AcDbXrecord
280
1
90
1
0
XRECORD
5
BE
330
9C
100
AcDbXrecord
280
1
40
0.5
0
XRECORD
5
BF
330
9C
100
AcDbXrecord
280
1
40
0.5
0
XRECORD
5
C0
330
9C
100
AcDbXrecord
280
1
40
0.5
0
XRECORD
5
C1
330
9C
100
AcDbXrecord
280
1
40
0.5
0
XRECORD
5
C2
330
9C
100
AcDbXrecord
280
1
290
0
0
XRECORD
5
C3
330
9C
100
AcDbXrecord
280
1
90
1
0
XRECORD
5
C4
330
9C
100
AcDbXrecord
280
1
40
0.0
0
XRECORD
5
C5
330
9C
100
AcDbXrecord
280
1
40
0.0
0
XRECORD
5
C6
330
9C
100
AcDbXrecord
280
1
1000
Portrait
0
XRECORD
5
C7
330
9C
100
AcDbXrecord
280
1
40
11.0
0
XRECORD
5
C8
330
9C
100
AcDbXrecord
280
1
40
8.5
0
XRECORD
5
C9
330
9C
100
AcDbXrecord
280
1
1000
1:1
0
XRECORD
5
CA
330
9C
100
AcDbXrecord
280
1
290
1
0
XRECORD
5
CB
330
9C
100
AcDbXrecord
280
1
90
1
0
XRECORD
5
CD
330
9C
100
AcDbXrecord
280
1
40
1020.6402267597767377
0
XRECORD
5
CE
330
9C
100
AcDbXrecord
280
1
40
830.0034027960252843
0
ENDSEC
0
EOF
")
(defparameter *dxf-footer* *dxf-footer-new*)
(defparameter *dxf-header-pre-1592*
" 0
SECTION
2
HEADER
9
$ACADVER
1
AC1009
9
$DWGCODEPAGE
3
ANSI_1252
9
$INSBASE
10
0.0
20
0.0
30
0.0
9
$EXTMIN
10
-500.0
20
-500.0
30
1.000000000000000E+20
9
$EXTMAX
10
500.0
20
500.0
30
-1.000000000000000E+20
9
$LIMMIN
10
-500.0
20
-500.0
9
$LIMMAX
10
500.0
20
500.0
9
$ORTHOMODE
70
0
9
$LTSCALE
40
1.0
9
$TEXTSTYLE
7
Standard
9
$LUNITS
70
2
9
$LUPREC
70
4
9
$SPLINESEGS
70
8
9
$INSUNITS
70
4
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
STYLE
70
1
0
STYLE
2
GDLSTYLE
70
0
40
0.0
41
1.0
50
0.0
71
0
42
0.2
3
TXT
0
ENDTAB
0
TABLE
2
LTYPE
70
3
0
LTYPE
2
DASHED
70
64
3
__ __ __ __
72
65
73
2
40
0.75
49
0.5
49
-0.25
0
LTYPE
2
CENTER
70
64
3
___ _ ___ _ ___
72
65
73
4
40
0.75
49
0.4
49
-0.1
49
0.15
49
-0.1
0
LTYPE
2
DASHDOT
70
64
3
__ . __ . __
72
65
73
4
40
0.75
49
0.5
49
-0.12495
49
0.0001
49
-0.12495
0
ENDTAB
0
ENDSEC
0
SECTION
2
ENTITIES
")
(defparameter *dxf-footer-pre-1592*
" 0
ENDSEC
0
EOF
")
(define-format dxf (2d-output))
(defun legacy-dxf ()
(setq *dxf-header* *dxf-header-pre-1592*
*dxf-footer* *dxf-footer-pre-1592*)
(format t "Switched to legacy DXF header and footer.~%"))
(defun new-dxf ()
(setq *dxf-header* *dxf-header-new*
*dxf-footer* *dxf-footer-new*)
(format t "Switched to new DXF header and footer.~%"))
| 26,442 | Common Lisp | .lisp | 4,030 | 5.001241 | 70 | 0.777549 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 1acb40758861097e232978aea2d225cf199da6e6fb392050ee84f31a1beb1074 | 35,734 | [
-1
] |
35,735 | pdf.lisp | lisp-mirror_gendl/geom-base/formats/source/pdf.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-format pdf (2d-output)
:documentation (:author "David J Cooper Jr [Genworks]"
:description "PDF is the most developed output format in GDL currently. Using PDF you can produce wireframe
renderings for geometric objects, text output with specified fonts and sizes, and arbitrary PDF commands. Full-blown typeset
output is coming later.")
:functions
((postnet-bar
(digits)
(let ((low-bar 3.6) (high-bar 9) (spacing 3.9))
(pdf:with-saved-state (pdf:set-line-width 1.44)
(pdf:move-to 0 0)
(pdf:line-to 0 high-bar) (pdf:stroke)
(pdf:translate spacing 0) (pdf:move-to 0 0)
(dolist (digit digits)
(write-env (:postnet-digit digit high-bar low-bar spacing)))
(pdf:line-to 0 high-bar) (pdf:stroke))))
(postnet-digit
(digit high-bar low-bar spacing)
(let ((bits (aref +postnet-bits+ digit)))
(dolist (bit bits)
(pdf:line-to 0 (if bit high-bar low-bar)) (pdf:stroke)
(pdf:translate spacing 0) (pdf:move-to 0 0))))))
| 1,970 | Common Lisp | .lisp | 43 | 40.232558 | 126 | 0.686646 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | e6f4a22e4f885b063c9ccaf9bc16b96f601aba1b6fb30d12f932dada91686ec4 | 35,735 | [
-1
] |
35,736 | 2d-output.lisp | lisp-mirror_gendl/geom-base/formats/source/2d-output.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-format 2d-output (base-format)
:slots ((view nil) (page-width 612) (page-length 792)
(view-scale nil) (view-transform nil) (view-center nil)))
(defmethod initialize-instance :after ((object 2d-output) &rest init-options)
(declare (ignore init-options))
(when (slot-value object 'gdl-acc::view-scale) (warn "view-scale initarg for 2d-output is deprecated."))
(when (slot-value object 'gdl-acc::view-transform) (warn "view-transform initarg for 2d-output is deprecated."))
(when (slot-value object 'gdl-acc::view-center) (warn "view-center initarg for 2d-output is deprecated."))
)
| 1,536 | Common Lisp | .lisp | 30 | 47.266667 | 115 | 0.728997 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 6af75cad234b75aaccf1550b7c1f4325d6950f59ee47c8d20f7838f2457e74aa | 35,736 | [
-1
] |
35,737 | vector-graphics.lisp | lisp-mirror_gendl/geom-base/formats/source/vector-graphics.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-format vector-graphics (2d-output))
(define-format raphael (vector-graphics)
:documentation (:author "David J Cooper Jr [Genworks]"
:description "Raphael is a small JavaScript library for vector graphics"))
(define-format svg (vector-graphics)
:documentation (:author "David J Cooper Jr [Genworks]"
:description "Direct SVG for inline inclusion in a web page or application"))
| 1,327 | Common Lisp | .lisp | 28 | 43.464286 | 96 | 0.730023 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 183ea4aa5db72a1bb3cfdf124e4545b2b7827dfbaa956dbeec04d3dd5f735bb6 | 35,737 | [
-1
] |
35,738 | polynomial.lisp | lisp-mirror_gendl/geom-base/math/source/polynomial.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(defun get-zeroes-in-interval
(coefficient-array min max
&key roots (degree (- (array-dimension coefficient-array 0) 1))
(accuracy (* 10.0 double-float-epsilon)) (maximum-number-of-iterations 30))
(let ((function (make-polynomial-function coefficient-array))
(function-prime (make-polynomial-function (poly-prime coefficient-array))))
(if (= degree 1)
(let ((root (newton-raphson function function-prime min max
:accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations)))
(when root (push root roots)))
(let ((droots (get-zeroes-in-interval (poly-prime coefficient-array) min max
:roots roots :degree (1- degree)
:accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations)))
(if droots
(progn
(let ((root (newton-raphson function function-prime min (first droots)
:accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations)))
(when root (push root roots)))
(dotimes (i (- (length droots) 2))
(let ((root (newton-raphson function function-prime (nth i droots) (nth (1+ i) droots)
:accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations)))
(when root (push root roots))))
(let ((root (newton-raphson function function-prime (nth (1- (length droots)) droots) max
:accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations)))
(when root (push root roots))))
(let ((root (newton-raphson function function-prime min max
:accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations)))
(when root (push root roots))))))) roots)
(defun make-polynomial-function (coefficient-array)
#'(lambda(num) (evaluate-polynomial coefficient-array num)))
;;
;; FLAG -- look at making this tail-recursive.
;;
(defun evaluate-polynomial (coefficient-array num)
(let ((degree (1- (array-dimension coefficient-array 0))))
(if (zerop degree)
(elt coefficient-array 0)
(+ (evaluate-polynomial (subseq coefficient-array 1) num)
(* (elt coefficient-array 0) (expt num degree))))))
(defun newton-raphson (function function-prime min max
&key (accuracy (* 10.0 double-float-epsilon))
(maximum-number-of-iterations 30))
(assert (<= min max))
(let ((x (half (+ min max))) delta-x accuracy-denominator)
(dotimes (j maximum-number-of-iterations)
(let ((f-result (funcall function x))
(f-prime-result (funcall function-prime x)))
(when (zerop f-prime-result) (return nil))
(setq delta-x (/ f-result f-prime-result)
accuracy-denominator (+ (abs x) (abs (decf x delta-x))))
(when (< x min) (setq x min))
(when (> x max) (setq x max))
(when (and (not (zerop accuracy-denominator))
(< (/ (abs delta-x) accuracy-denominator) accuracy))
(return (values x (1+ j))))))))
(defun poly-prime (coefficient-array)
(let ((degree (array-dimension coefficient-array 0)))
(make-array (list (1- degree))
:initial-contents (let ((power degree))
(map 'list #'(lambda(coefficient)
(* coefficient (decf power)))
(subseq coefficient-array 0 (1- degree)))))))
| 5,025 | Common Lisp | .lisp | 89 | 41.426966 | 106 | 0.569932 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | d3782818e2d939f0c7bb4dd9bed35019e5058946e98553821ca76eebc8b808e8 | 35,738 | [
-1
] |
35,739 | box.lisp | lisp-mirror_gendl/geom-base/wire/source/box.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object box (base-object)
:documentation (:description "This represents a ``visible'' base-object -- a six-sided box with all the same
messages as base-object, which knows how to output itself in various formats."
:examples "<pre>
(in-package :gdl-user)
(define-object box-sample (box)
:computed-slots ((display-controls (list :color :blue-neon))
(length 10)
(width (* (the length) +phi+))
(height (* (the width) +phi+))))
(generate-sample-drawing :objects (make-object 'box-sample)
:projection-direction (getf *standard-views* :trimetric))
</pre>")
:computed-slots
(("Number. Total volume of the box."
volume (* (the length) (the width) (the height)))
(%renderer-info% (list :vrml? t :view-default :trimetric))
(%vertex-array% (make-array 8 :initial-contents (list (the (vertex :top :right :rear))
(the (vertex :top :left :rear))
(the (vertex :top :left :front))
(the (vertex :top :right :front))
(the (vertex :bottom :right :rear))
(the (vertex :bottom :left :rear))
(the (vertex :bottom :left :front))
(the (vertex :bottom :right :front)))))
(%line-vertex-indices% (list (list 0 1) (list 1 2) (list 2 3) (list 3 0)
(list 0 4) (list 1 5) (list 2 6) (list 3 7)
(list 4 5) (list 5 6) (list 6 7) (list 7 4)))
;;
;; FLAG -- this should be able to be dumped at some point.
;;
(%lines-to-draw% (let ((top-left-rear (the (vertex :top :left :rear)))
(top-right-rear (the (vertex :top :right :rear)))
(top-left-front (the (vertex :top :left :front)))
(top-right-front (the (vertex :top :right :front)))
(bottom-left-rear (the (vertex :bottom :left :rear)))
(bottom-right-rear (the (vertex :bottom :right :rear)))
(bottom-left-front (the (vertex :bottom :left :front)))
(bottom-right-front (the (vertex :bottom :right :front))))
(list (list top-left-rear top-right-rear)
(list top-right-rear top-right-front)
(list top-right-front top-left-front)
(list top-left-front top-left-rear)
(list top-left-rear bottom-left-rear)
(list top-right-rear bottom-right-rear)
(list top-right-front bottom-right-front)
(list top-left-front bottom-left-front)
(list bottom-left-rear bottom-right-rear)
(list bottom-right-rear bottom-right-front)
(list bottom-right-front bottom-left-front)
(list bottom-left-front bottom-left-rear)))))
:functions
((in?
(point)
(let ((x (get-x point))
(y (get-y point))
(z (get-z point)))
(and (> (get-x (the (face-center :left))) x (get-x (the (face-center :right))))
(> (get-y (the (face-center :front))) y (get-y (the (face-center :rear))))
(> (get-z (the (face-center :bottom))) z (get-z (the (face-center :top)))))))
("3d-point."
closest-vertex (point)
(least #'(lambda(vertex)
(3d-distance vertex point))
(list (the (:vertex :top :right :rear))
(the (:vertex :top :left :rear))
(the (:vertex :top :right :front))
(the (:vertex :top :left :front))
(the (:vertex :bottom :right :rear))
(the (:vertex :bottom :left :rear))
(the (:vertex :bottom :right :front))
(the (:vertex :bottom :left :front)))))))
(define-lens (obj box)()
:output-functions
((cad-output
()
(let ((vertex-array (the %vertex-array%)))
;;
;; FLAG -- replace format with something more efficent
;;
(format *stream* "
v ~2,7f ~2,7f ~2,7f
v ~2,7f ~2,7f ~2,7f
v ~2,7f ~2,7f ~2,7f
v ~2,7f ~2,7f ~2,7f
v ~2,7f ~2,7f ~2,7f
v ~2,7f ~2,7f ~2,7f
v ~2,7f ~2,7f ~2,7f
v ~2,7f ~2,7f ~2,7f
f ~a ~a ~a ~a
f ~a ~a ~a ~a
l ~a ~a
l ~a ~a
l ~a ~a
l ~a ~a
"
(get-x (aref vertex-array 0)) (get-y (aref vertex-array 0)) (get-z (aref vertex-array 0))
(get-x (aref vertex-array 1)) (get-y (aref vertex-array 1)) (get-z (aref vertex-array 1))
(get-x (aref vertex-array 2)) (get-y (aref vertex-array 2)) (get-z (aref vertex-array 2))
(get-x (aref vertex-array 3)) (get-y (aref vertex-array 3)) (get-z (aref vertex-array 3))
(get-x (aref vertex-array 4)) (get-y (aref vertex-array 4)) (get-z (aref vertex-array 4))
(get-x (aref vertex-array 5)) (get-y (aref vertex-array 5)) (get-z (aref vertex-array 5))
(get-x (aref vertex-array 6)) (get-y (aref vertex-array 6)) (get-z (aref vertex-array 6))
(get-x (aref vertex-array 7)) (get-y (aref vertex-array 7)) (get-z (aref vertex-array 7))
(+ *vertex-count* 1) (+ *vertex-count* 2)(+ *vertex-count* 3)(+ *vertex-count* 4)
(+ *vertex-count* 5) (+ *vertex-count* 6)(+ *vertex-count* 7)(+ *vertex-count* 8)
(+ *vertex-count* 1)(+ *vertex-count* 5)
(+ *vertex-count* 2)(+ *vertex-count* 6)
(+ *vertex-count* 3)(+ *vertex-count* 7)
(+ *vertex-count* 4)(+ *vertex-count* 8)))
(incf *vertex-count* 8)
)))
| 6,991 | Common Lisp | .lisp | 133 | 38.571429 | 111 | 0.524043 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9ce276a7ceb8c73a4e67e45e44b14f9c2db01d2fd613c8dbf8911affc5a2cd40 | 35,739 | [
-1
] |
35,740 | arc.lisp | lisp-mirror_gendl/geom-base/wire/source/arc.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object arc (arcoid-mixin base-object)
:documentation (:description "A segment of a circle.
The start point is at the 3 o'clock position, and positive
angles are measured anti-clockwise."
:examples "<pre>
(in-package :gdl-user)
(define-object arc-sample (arc)
:computed-slots ((radius 30) (end-angle (half pi/2))))
(generate-sample-drawing :objects (make-object 'arc-sample))
</pre>")
:input-slots
("Number. Distance from center to any point on the arc."
radius
(arc 2pi)
("Angle in radians. Start angle of the arc. Defaults to zero."
start-angle 0)
("Angle in radians. End angle of the arc. Defaults to twice pi."
end-angle (the arc)))
:computed-slots
((%curves-to-draw%
(when (not (zerop (the radius)))
(if (and (= (the :start-angle-normalized) 0)
(= (the :end-angle-normalized) (twice pi)))
(progn
(list (the (:circle-point-list :right :rear))
(the (:circle-point-list :rear :left))
(the (:circle-point-list :left :front))
(the (:circle-point-list :front :right))))
(let* ((number-of-sub-arcs (ceiling (/ (the :start-to-end-angle) (half pi))))
(angle-per-sub-arc (/ (the :start-to-end-angle) number-of-sub-arcs))
(start-angle-normalized (the :start-angle-normalized))
result)
(dotimes (n number-of-sub-arcs (nreverse result))
(push (sub-arc (the :radius)
(+ start-angle-normalized (* n angle-per-sub-arc))
(+ start-angle-normalized (* (1+ n) angle-per-sub-arc))
(the :center)
(the (:face-normal-vector :right))
(the (:face-normal-vector :rear))
(the (:face-normal-vector :front))
(the (:face-normal-vector :top))) result))))))
(%renderer-info% (list :vrml? t :view-default :top))
(curves (the :%curves-to-draw%))
("3D Point. The start point of the arc."
start (first (first (the :curves))))
("3D Point. The end point of the arc."
end (fourth (lastcar (the :curves))))
(height 0) (width (twice (the radius))) (length (the width)))
:functions
((circle-point-list
(face-1 face-2)
(let ((center (the :center))
(radius (the :radius))
(kappa-factor (* (the :radius) +kappa+)))
(list (translate center face-1 radius)
(translate center face-1 radius face-2 kappa-factor)
(translate center face-2 radius face-1 kappa-factor)
(translate center face-2 radius))))
(interpolated-points
(&key (curve-chords *curve-chords*))
(let ((beziers (list-elements (the beziers))))
(case (length beziers)
(0)
(1 (the-object (first beziers) (equi-spaced-points curve-chords)))
(2 (append (butlast (the-object (first beziers) (equi-spaced-points curve-chords)))
(the-object (second beziers) (equi-spaced-points curve-chords))))
(otherwise (append (mapcan #'(lambda(bezier)
(butlast (the-object bezier (equi-spaced-points curve-chords))))
(butlast beziers))
(the-object (lastcar beziers) (equi-spaced-points curve-chords)))))))
("3D Vector. Returns the tangent to the arc at the given point (which should be on the arc).
:arguments (point \"3D point. The point at which you want the tangent.\")"
tangent
(point)
(let ((top (the (face-normal-vector :top)))
(radial (subtract-vectors point (the center))))
(cross-vectors top radial)))
("List of points. Returns a list of points equally spaced around the arc, including
the start and end point of the arc.
:&optional ((number-of-points 4) \"Number. How many points to return.\")"
equi-spaced-points
(&optional (number-of-points 4))
(when (>= number-of-points 1)
(let ((delta (div (the start-to-end-angle) (1- number-of-points))) result)
(dotimes (n number-of-points result)
(push (the (point-on-arc (* n delta))) result)))))
("3D Point. The point on the arc at a certain angle from the start.
:arguments (angle \"Number in Radians\")"
point-on-arc
(angle)
(if (the start)
(rotate-point (the start) (the center) (the (face-normal-vector :top)) :angle angle)
(the center)))
(angle-at-point
(point &key negative?)
(let ((projected (inter-line-plane point (the (face-normal-vector :top))
(the center) (the (face-normal-vector :top)))))
(angle-between-vectors (the (face-normal-vector :right))
(subtract-vectors projected (the center))
(the (face-normal-vector :top))
:negative? negative?)))))
| 5,962 | Common Lisp | .lisp | 122 | 38.991803 | 105 | 0.607637 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 735d989375f4320df67e8e90f755c3b3868b4341bda342840a0863f6329f5683 | 35,740 | [
-1
] |
35,741 | global-polygon-projection.lisp | lisp-mirror_gendl/geom-base/wire/source/global-polygon-projection.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object global-polygon-projection (ifs-output-mixin base-object)
:documentation (:description "A polygon ``extruded'' for a given distance along a single vector.
For planar polygons, the projection vector must not be orthogonal to the normal of the plane of
the polygon. The vertices and projection-vector are given in the global coordinate system, so
the local center and orientation do not affect the positioning or orientation of this part."
:examples "<pre>
(in-package :gdl-user)
(define-object global-polygon-projection-sample (global-polygon-projection)
:computed-slots
((display-controls (list :color :gold-old :transparency 0.3))
(projection-depth 5)
(vertex-list (list (make-point 0 0 0)
(make-point 10 10 0)
(make-point 30 10 0)
(make-point 40 0 0)
(make-point 30 -10 0)
(make-point 10 -10 0)
(make-point 0 0 0)))))
(generate-sample-drawing :objects (make-object 'global-polygon-projection-sample)
:projection-direction (getf *standard-views* :trimetric))
</pre>")
:input-slots
("Number. The resultant distance from the two end faces of the extrusion."
projection-depth
"List of 3D points. The vertex list making up the polyline, same as the input for global-polyline."
vertex-list
("Keyword symbol. The direction of extrusion with respect to the vertices in vertex-list and the projection-vector:
<ul>
<li><tt>:up</tt> Indicates to start from current location of vertices and move in the direction of
the projection-vector.</li>
<li><tt>:down</tt> Indicates to start from current location of vertices and move in the direction opposite
the projection-vector.</li>
<li><tt>:center</tt> Indicates to start from current location of vertices and move in the direction of
the projection-vector <i>and</i> opposite the projection-vector, going half the projection-depth in
each direction.</li>
</ul>"
offset :up)
("3D Vector. Indicates the straight path along which the extrusion should occur."
projection-vector (cross-vectors (subtract-vectors (second (the :vertex-list))
(first (the :vertex-list)))
(subtract-vectors (third (the :vertex-list))
(first (the :vertex-list))))))
:computed-slots
((polygon-type 'global-polyline)
(%renderer-info% (list :vrml? t :view-default :trimetric))
(crease-angle 0)
(%lines-to-draw% (append
(the :polygon-original :%lines-to-draw%)
(the :polygon-1 :%lines-to-draw%)
(when (typep (the :polygon-2) (the :polygon-type))
(the :polygon-2 :%lines-to-draw%))
(the :projection-lines)))
(projection-lines (mapcar #'list
(butlast
(the-object
(if (typep (the :polygon-2) (the :polygon-type))
(the :polygon-2)
(the :polygon-original)) :vertex-list))
(butlast (the :polygon-1 :vertex-list))))
(bounding-box (bounding-box-from-points (append (the polygon-original vertex-list)
(the polygon-1 vertex-list))))
(polygon-2-effective (if (typep (the polygon-2) (the polygon-type))
(the polygon-2) (the polygon-original)))
(%vertex-array% (let ((curve-pts (flatten-curves (the %curves-to-draw%))))
(make-array (+ (twice (length (the polygon-original vertex-list)))
(length curve-pts))
:initial-contents
(append (the polygon-1 vertex-list)
(the polygon-2-effective vertex-list)
curve-pts))))
(%line-vertex-indices%
(let* ((num-of-vertices (length (the polygon-original vertex-list)))
(poly-1-indices (list-of-numbers 0 (1- num-of-vertices)))
(poly-2-indices (list-of-numbers num-of-vertices
(1- (twice num-of-vertices)))))
(append (mapcar #'list
poly-1-indices (append (rest poly-1-indices) (list (first poly-1-indices))))
(mapcar #'list
poly-2-indices
(append (rest poly-2-indices) (list (first poly-2-indices))))
(mapcar #'list
poly-1-indices poly-2-indices))))
;;
;; FLAG -- figure out proper normals for these.
;;
(polygons-for-ifs
(let ((p1-list (the polygon-1 vertex-list))
(p2-list (the polygon-2-effective vertex-list)))
(cons (butlast p1-list)
(append
(mapcar #'(lambda(p1-v1 p1-v2 p2-v1 p2-v2)
(list p1-v1 p1-v2 p2-v2 p2-v1))
p1-list (rest p1-list) p2-list (rest p2-list))
(list (butlast p2-list)))))))
:hidden-objects
((polygon-original :type (the :polygon-type)
:pass-down (:radius-list :default-radius)
:vertex-list (if (coincident-point? (first (the :vertex-list))
(lastcar (the :vertex-list)))
(the :vertex-list)(append (the :vertex-list)
(list (first (the :vertex-list))))))
(polygon-1 :type (the :polygon-type)
:pass-down (:radius-list :default-radius)
:vertex-list (mapcar #'(lambda(vertex)
(translate-along-vector
vertex (ecase (the :offset)
((:up :center) (the :projection-vector))
(:down (reverse-vector (the :projection-vector))))
(ecase (the :offset)
((:up :down) (the :projection-depth))
(:center (half (the :projection-depth))))))
(the :polygon-original :vertex-list)))
(polygon-2 :type (ecase (the :offset) ((:up :down) 'null-part) (:center (the :polygon-type)))
:pass-down (:radius-list :default-radius)
:vertex-list (mapcar #'(lambda(vertex)
(translate-along-vector
vertex (reverse-vector (the :projection-vector))
(half (the :projection-depth))))
(the :polygon-original :vertex-list)))))
(define-object ifs-output-mixin ()
:input-slots
(polygons-for-ifs
(crease-angle (half pi)))
:computed-slots
((ifs-vertex-ht (when (the polygons-for-ifs)
(let ((ht (make-hash-table :test #'equalp))
(count -1))
(dolist (polygon (the polygons-for-ifs) ht)
(dolist (vertex polygon)
(let ((current (gethash vertex ht)))
(unless current
(setf (gethash vertex ht) (incf count)))))))))
(ifs-array (when (the polygons-for-ifs)
(let ((array (make-array (list (hash-table-count (the ifs-vertex-ht))))))
(maphash #'(lambda(vertex index)
(setf (aref array index) vertex))
(the ifs-vertex-ht)) array)))
(ifs-indices (when (the polygons-for-ifs)
(mapcar #'(lambda(polygon)
(mapcar #'(lambda(vertex)
(gethash vertex (the ifs-vertex-ht)))
polygon))
(the polygons-for-ifs))))))
| 8,756 | Common Lisp | .lisp | 164 | 39.042683 | 119 | 0.566528 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | c71c3b996566cceaf43a69f30ab274ce73b0cf5ec5ba496b4d2dcdb196ef26bf | 35,741 | [
-1
] |
35,742 | spot-light.lisp | lisp-mirror_gendl/geom-base/wire/source/spot-light.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
| 888 | Common Lisp | .lisp | 21 | 39.952381 | 71 | 0.743917 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 561494a90b30aa1f2e35291059d7ec99765aea3a09d1999edc3d1ddd305d3fd7 | 35,742 | [
-1
] |
35,743 | c-cylinder.lisp | lisp-mirror_gendl/geom-base/wire/source/c-cylinder.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
;;
;; FLAG -- consider name change to something less cryptic
;;
(define-object c-cylinder (cylinder)
:documentation
(:description "Provides a simple way to create a cylinder, by specifying a start point and an end point."
:examples "<pre>
(in-package :gdl-user)
(define-object c-cylinder-sample (c-cylinder)
:computed-slots
((display-controls (list :color :plum :transparency 0.2))
(start (make-point 0 0 0))
(end (make-point 0 0 10))
(number-of-sections 7)
(radius 3)))
(generate-sample-drawing :objects (make-object 'c-cylinder-sample)
:projection-direction (getf *standard-views* :trimetric))
</pre>")
:input-slots ("3D Point. Center of the start cap." start
"3D Point. Center of the end cap." end)
:computed-slots
((%renderer-info% (list :vrml? t :view-default :trimetric))
("List of two 3D Points. Represents line segment connecting center of end cap to center of start cap."
center-line (list (the :end) (the :start)))
("3D Point. Center point of the center-line."
center (mid-point (the :center-line)))
("Number. Distance between cap centers."
length (line-length (the :center-line)))
("3x3 Orthonormal Rotation Matrix. Resultant orientation given the specified start and end points."
orientation (alignment :front (direction-vector (the :center-line))))))
| 2,350 | Common Lisp | .lisp | 51 | 40.647059 | 108 | 0.701339 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 015cecb868abbaa1438efd33d833bb1c45bb3b6e75fb3e1ad3409518d4457cc3 | 35,743 | [
-1
] |
35,744 | views.lisp | lisp-mirror_gendl/geom-base/wire/source/views.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(defun matrix-lh-to-rh (lh-matrix)
(let ((rh-matrix (make-array (list 3 3) :element-type 'double-float)))
(setf (aref rh-matrix 0 0) (aref lh-matrix 0 0)
(aref rh-matrix 0 1) (aref lh-matrix 0 1)
(aref rh-matrix 0 2) (- (aref lh-matrix 0 2))
(aref rh-matrix 1 0) (aref lh-matrix 1 0)
(aref rh-matrix 1 1) (aref lh-matrix 1 1)
(aref rh-matrix 1 2) (- (aref lh-matrix 1 2))
(aref rh-matrix 2 0) (- (aref lh-matrix 2 0))
(aref rh-matrix 2 1) (- (aref lh-matrix 2 1))
(aref rh-matrix 2 2) (aref lh-matrix 2 2))
rh-matrix))
(define-lens (base-format base-object)()
:output-functions
((cad-output-tree
()
(if (the leaf?) (write-the cad-output)
(progn
(mapc #'(lambda(child) (write-the-object child cad-output-tree)) (the children)))))))
;;
;; FLAG -- is this really needed? Doesn't look like it does anything...
;;
(define-lens (2d-output base-object)()
:output-functions
((cad-output
()
(call-next-method))))
(define-lens (pdf base-object)()
:output-functions
((rgb-stroke-setting
()
(let* ((display-controls (find-in-hash self *display-controls*))
(color (or (getf display-controls :color)
(the color-decimal)))
(color-decimal (if (consp color) color
(coerce (lookup-color (or color (format-slot foreground-color))) 'list)))
(fill-color-decimal (coerce (lookup-color (getf (the display-controls) :fill-color)) 'list)))
(apply #'pdf:set-rgb-stroke color-decimal)
(apply #'pdf:set-rgb-fill (or fill-color-decimal color-decimal))))
;;
;; FLAG -- remove this defunct version.
;;
#+nil
(rgb-stroke-setting
()
(let* ((display-controls (find-in-hash self *display-controls*))
(color (or (getf display-controls :color)
(getf (the display-controls) :color)
:black))
(color-decimal (coerce (lookup-color (or color (format-slot foreground-color))) 'list))
(fill-color-decimal (coerce (lookup-color (getf (the display-controls) :fill-color)) 'list)))
(apply #'pdf:set-rgb-stroke color-decimal)
(apply #'pdf:set-rgb-fill (or fill-color-decimal color-decimal))))
(line-thickness-setting
()
(let* ((display-controls (or (find-in-hash self *display-controls*) (the display-controls)))
(line-thickness (getf display-controls :line-thickness))
(line-thickness (or line-thickness (the line-thickness))))
(pdf:set-line-width line-thickness)))
(dash-pattern-setting
()
(let* ((display-controls (or (find-in-hash self *display-controls*)
(the display-controls)))
(dash-pattern (getf display-controls :dash-pattern))
(dash-pattern (or dash-pattern (the dash-pattern))))
(when dash-pattern
(pdf:set-dash-pattern (list (first dash-pattern) (second dash-pattern))
(or (third dash-pattern) 0)))))
))
(define-lens (dxf base-object)()
:output-functions
(
;;
;; FLAG -- fill in.
;;
(line-thickness-setting
()
(let* ((display-controls (find-in-hash self *display-controls*))
(line-thickness (getf display-controls :line-thickness))
(line-thickness (or line-thickness (the line-thickness))))
(declare (ignorable line-thickness))
(warn "Add the setting of DXF line thickness")))
;;
;; FLAG -- fill in.
;;
(rgb-stroke-setting
()
(let* ((display-controls (or (find-in-hash self *display-controls*)
(the display-controls)))
(color-decimal (getf display-controls :color-decimal))
(color-decimal (or color-decimal (coerce (or (the color-decimal)
(format-slot foreground-color)
(lookup-color (the color-decimal))) 'list)))
(dxf-color-code (or (getf display-controls :dxf-color-code)
0))
(dxf-layer-number (or (getf display-controls :dxf-layer-number)
0)))
(declare (ignorable color-decimal))
;; FLAG -- work colors & layers back in.
(unless (zerop dxf-color-code)
(format *stream* " 62~%~a~%" dxf-color-code))
(format *stream* " 8~%~a~%" (if (zerop dxf-layer-number) "Main" dxf-layer-number))
))
(dash-pattern-setting
()
(let* ((display-controls (find-in-hash self *display-controls*))
(dash-pattern (getf display-controls :dash-pattern))
(dash-pattern (or dash-pattern (the dash-pattern))))
(declare (ignorable dash-pattern))
(warn "Add the setting of DXF dash pattern")))))
;;
;; FLAG -- the following has been folded into %lines-to-draw% and %curves-to-draw% to avoid
;; the need for separate views. But it works this way for now.
;;
#+nil
(define-lens (dxf global-filleted-polyline)()
:output-functions
((cad-output
()
(let ((lines (the straights))
(fillets (list-elements (the fillets))))
;;(write-the line-thickness-setting)
;;(write-the rgb-stroke-setting)
(with-format-slots (view)
(mapc #'(lambda(line)
(destructuring-bind (start end)
(mapcar #'(lambda(vertex)
(let ((vertex (if view (the-object view (view-point vertex)) vertex)))
(add-vectors (subseq vertex 0 2) *dxf-translation*))) line)
(format *stream* " 0~%LINE~% 10~%~3,16f~% 20~%~3,16f~% 11~%~3,16f~% 21~%~3,16f~%"
(get-x start) (get-y start) (get-x end) (get-y end))
;;(write-the line-thickness-setting)
;;(write-the rgb-stroke-setting)
)) lines)
(mapc #'(lambda(arc)
(let ((angle-correction
(angle-between-vectors-d +rear-vector+
(the (face-normal-vector :rear))
+top-vector+)))
(let ((start-angle (+ (radians-to-degrees
(the-object arc start-angle-normalized)) angle-correction))
(end-angle (+ (radians-to-degrees
(the-object arc end-angle-normalized)) angle-correction))
(radius (* (the-object arc radius) (the-object view view-scale-total)))
(center (add-vectors *dxf-translation*
(let ((point (the-object arc center)))
(if view (the-object view (view-point point)) point))))
(top-vector (the-object arc (face-normal-vector :top))))
(format *stream* " 0~%ARC~% 10~%~3,16f~% 20~%~3,16f~% 30~%~3,16f~% 40~%~3,15f
50~%~3,15f~% 51~%~3,15f~% 210~%~3,15f~% 220~%~3,15f~% 230~%~3,15f~%"
(get-x center) (get-y center) 0 radius start-angle end-angle
(get-x top-vector) (get-y top-vector) (get-z top-vector)))
;;(write-the line-thickness-setting)
;;(write-the rgb-stroke-setting)
)
( )) fillets)
)))))
#+nil
(define-lens (dxf global-polyline)()
:output-functions
((cad-output
()
(with-format-slots (view)
(let ((line-index-pairs (the %%line-vertex-indices%%))
(2d-vertices (map 'vector (if view #'(lambda(point) (the-object view (view-point point))) #'identity)
(the %%vertex-array%%))))
;;
;; FLAG -- add setting of fill color
;;
(let ((2d-vertices (map 'vector #'(lambda(vertex)
(add-vectors (subseq vertex 0 2) *dxf-translation*)) 2d-vertices)))
(mapc #'(lambda(line-index-pair)
(destructuring-bind (start-index end-index) line-index-pair
(let ((start (svref 2d-vertices start-index))
(end (svref 2d-vertices end-index)))
(format *stream* " 0~%LINE~% 8~%0~% 10~%~3,16f~% 20~%~3,16f~% 11~%~3,16f~% 21~%~3,16f~%"
(get-x start) (get-y start) (get-x end) (get-y end))))
(write-the line-thickness-setting)
(write-the rgb-stroke-setting)
)
line-index-pairs)))))))
| 10,142 | Common Lisp | .lisp | 202 | 35.881188 | 115 | 0.545875 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 08f40a2ad9b625a2c13d0864f9c31ff5fb3fc2ebd7aac817c14d07043ad1bcf2 | 35,744 | [
-1
] |
35,745 | fillet.lisp | lisp-mirror_gendl/geom-base/wire/source/fillet.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object fillet (arc)
:input-slots
(local-vertex direction-vectors)
:computed-slots
((normal (apply #'cross-vectors (the direction-vectors)))
(orientation (alignment :top (the normal)))
(angle (apply #'angle-between-vectors (append (the :direction-vectors)
(list (the normal) :-ve t))))
(other-angle (- pi (the :angle)))
(distance-to-tangent (* (the :radius)
(tan (half (the :other-angle)))))
(tangents (mapcar #'(lambda(vector)
(translate-along-vector (the :local-vertex) vector (the :distance-to-tangent)))
(the :direction-vectors)))
(keep-vector (subtract-vectors (the :local-vertex) (the :center)))
(start-to-end-angle (twice (angle-between-vectors
(the :keep-vector)
(subtract-vectors (first (the :tangents)) (the :center))
(the normal) :-ve t)))
(start-tangent (if (minusp (angle-between-vectors
(subtract-vectors (first (the :tangents)) (the :center))
(subtract-vectors (second (the :tangents)) (the :center))
(the normal) :-ve t))
(second (the :tangents)) (first (the :tangents))))
(start-angle (angle-between-vectors (the (:face-normal-vector :right))
(subtract-vectors (the :start-tangent) (the :center))
(the normal) :-ve t))
(start-angle-normalized (mod (the start-angle) 2pi))
(end-angle (+ (the start-angle-normalized) (the start-to-end-angle)))
(center (inter-line-plane
(first (the :tangents))
(rotate-vector (first (the :direction-vectors))
(half pi)
(the (:face-normal-vector :top)))
(second (the :tangents)) (second (the :direction-vectors))))))
| 2,995 | Common Lisp | .lisp | 56 | 40.625 | 105 | 0.596236 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | f4f8af2eed0c285348c2c8f5a1fab55776bb351c3e6bf08125c94f1be1e3ed4f | 35,745 | [
-1
] |
35,746 | primitives.lisp | lisp-mirror_gendl/geom-base/wire/source/primitives.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(defun circle-point-list (center radius face-1-vector face-2-vector &optional (kappa-factor (* radius +kappa+)))
(list (translate-along-vector center face-1-vector radius)
(translate-along-vector (translate-along-vector center face-1-vector radius) face-2-vector kappa-factor)
(translate-along-vector (translate-along-vector center face-2-vector radius) face-1-vector kappa-factor)
(translate-along-vector center face-2-vector radius)))
;;
;; FLAG -- replace face hash tables with struct since it's always the
;; same 6 fields.
;;
(defun make-face-ht (orientation)
(let ((ht (make-hash-table :size 6)))
(if orientation
(setf (gethash :right ht) (array-to-3d-vector (matrix:multiply-matrix *nominal-x-array* orientation))
(gethash :left ht) (array-to-3d-vector (matrix:multiply-matrix *nominal-x-array-r* orientation))
(gethash :rear ht) (array-to-3d-vector (matrix:multiply-matrix *nominal-y-array* orientation))
(gethash :front ht) (array-to-3d-vector (matrix:multiply-matrix *nominal-y-array-r* orientation))
(gethash :top ht) (array-to-3d-vector (matrix:multiply-matrix *nominal-z-array* orientation))
(gethash :bottom ht) (array-to-3d-vector (matrix:multiply-matrix *nominal-z-array-r* orientation)))
(setf (gethash :right ht) *nominal-x-array*
(gethash :left ht) *nominal-x-array-r*
(gethash :rear ht) *nominal-y-array*
(gethash :front ht) *nominal-y-array-r*
(gethash :top ht) *nominal-z-array*
(gethash :bottom ht) *nominal-z-array-r*)) ht))
(defun arc-curves (face-ht radius center start-angle end-angle)
(if (and (= start-angle 0) (= end-angle 2pi))
(let ((kappa-factor (* radius +kappa+)))
(list (circle-point-list center radius (gethash :rear face-ht) (gethash :right face-ht) kappa-factor)
(circle-point-list center radius (gethash :right face-ht) (gethash :front face-ht) kappa-factor)
(circle-point-list center radius (gethash :front face-ht) (gethash :left face-ht) kappa-factor)
(circle-point-list center radius (gethash :left face-ht) (gethash :rear face-ht) kappa-factor)))
(let* ((start-to-end-angle (- end-angle start-angle))
(number-of-sub-arcs (ceiling (/ start-to-end-angle pi/2)))
(angle-per-sub-arc (/ start-to-end-angle number-of-sub-arcs))
result)
(dotimes (n number-of-sub-arcs (nreverse result))
(push (sub-arc radius
(+ start-angle (* n angle-per-sub-arc))
(+ start-angle (* (1+ n) angle-per-sub-arc))
center
(gethash :right face-ht)
(gethash :rear face-ht)
(gethash :front face-ht)
(gethash :top face-ht)) result)))))
| 3,878 | Common Lisp | .lisp | 65 | 50.230769 | 114 | 0.642687 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 44cdc05b51b97ef4d45810263276e36a5d1519ce2a87166ebff94c5027cd98fb | 35,746 | [
-1
] |
35,747 | torus.lisp | lisp-mirror_gendl/geom-base/wire/source/torus.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object torus (ifs-output-mixin arcoid-mixin base-object)
:documentation (:description "A single-holed ``ring'' torus, also known as an ``anchor ring.''
This is basically a circular cylinder ``bent'' into a donut shape. Partial donuts (``elbows'') are supported.
Partial ``bent'' cylinders are not currently supported."
:examples "<pre>
(in-package :gdl-user)
(define-object torus-sample (torus)
:computed-slots
((major-radius 150)
(minor-radius 42)
(draw-centerline-arc? t)
(number-of-longitudinal-sections 10)
(number-of-transverse-sections 10)
(display-controls (list :color :green-forest-medium)))
:hidden-objects ((view :type 'base-view
:projection-vector (getf *standard-views* :trimetric)
:page-width (* 5 72) :page-length (* 5 72)
:objects (list self))))
(generate-sample-drawing :objects (make-object 'torus-sample)
:projection-direction :trimetric)
</pre>")
:input-slots
("Number. Distance from center of donut hole to centerline of the torus."
major-radius
"Number. Radius of the bent cylinder making up the torus."
minor-radius
("Angle in Radians. Indicates the end angle for the donut. Defaults to twice pi for a full-circle donut."
arc 2pi :defaulting)
("Number. Radius of the inner hollow part of the bent cylinder for a hollow torus. Defaults to NIL for a solid cylinder"
inner-minor-radius nil)
("Boolean. Indicates whether the bent cylinder's centerline arc should be rendered in some renderings."
draw-centerline-arc? nil)
("Integer. Indicates the number of arcs to be drawn on along ``surface'' of the torus in some wireframe renderings."
number-of-longitudinal-sections 4)
("Integer. Indicates the number of circular cross-sections of the bent cylinder to show in some wireframe renderings."
number-of-transverse-sections 3)
("Boolean. Indicates whether to include end caps for a partial torus in some renderings. Defaults to T."
end-caps? (< (the major-radius) 2pi)))
:computed-slots
((%renderer-info% (list :vrml? t :view-default :trimetric))
(%curves-to-draw% (let* ((center (the :center))
(face-ht (the :%face-ht%))
(arc (the :end-angle-normalized))
(section-angle (the :section-angle))
(torus-arc-angle (the :torus-arc-angle))
(right-vector (gethash :right face-ht))
(front-vector (gethash :front face-ht))
(rear-vector (gethash :rear face-ht))
(top-vector (gethash :top face-ht))
(major-radius (the major-radius))
(minor-radius (the :minor-radius))
(torus-arc-curves (let (result)
(dotimes (index (the :number-of-longitudinal-sections) result)
(let* ((reference-point (translate center :right major-radius))
(sample-point (translate-along-vector
reference-point
(rotate-vector right-vector
(* index torus-arc-angle)
front-vector)
minor-radius))
(center (inter-line-plane sample-point right-vector
center right-vector))
(radius (3d-distance sample-point center)))
(let ((new-curves (arc-curves face-ht radius center 0 arc)))
(if result (nconc result new-curves) (setq result new-curves)))))))
(section-circle-curves (let (result)
(dotimes (index (1+ (the :number-of-transverse-sections)) result)
(let ((orientation (alignment :top (rotate-vector rear-vector
(* section-angle index)
top-vector)))
(center (translate-along-vector center
(rotate-vector right-vector
(* section-angle index)
top-vector)
major-radius)))
(let ((new-curves (arc-curves (make-face-ht orientation)
minor-radius
center 0 2pi)))
(if result (nconc result new-curves) (setq result new-curves))))))))
(append (when (the :draw-centerline-arc?) (the :centerline-arc :curves))
torus-arc-curves
section-circle-curves
(when (the :inner-minor-radius) (the :inner-torus :%curves-to-draw%)))))
(section-angle (/ (the end-angle-normalized) (the number-of-transverse-sections)))
(torus-arc-angle (/ (twice pi) (the :number-of-longitudinal-sections)))
(width (twice (+ (the major-radius) (the minor-radius))))
(length (the width)) (height (twice (the minor-radius)))
(equi-points (the centerline-arc (equi-spaced-points (1+ (the number-of-transverse-sections)))))
(polygon-points (mapcar #'(lambda(circle)
(the-object circle (equi-spaced-points (max 12 (the number-of-longitudinal-sections)))))
(list-elements (the transverse-circles))))
(polygons-for-ifs (apply #'append
(mapcar #'(lambda(circle-points-1 circle-points-2)
(mapcar #'(lambda (p1 p2 p3 p4)
(list p1 p2 p4 p3))
circle-points-1
(rest circle-points-1)
circle-points-2
(rest circle-points-2)))
(the polygon-points) (rest (the polygon-points))))))
:hidden-objects
((inner-torus :type (if (the :inner-minor-radius) 'torus 'null-part)
:pass-down (:arc
:number-of-transverse-sections
:number-of-longitudinal-sections)
:minor-radius (the :inner-minor-radius)
:major-radius (- (the :major-radius)
(- (the :inner-minor-radius)
(the :minor-radius))))
(transverse-circles :type 'circle
:radius (the minor-radius)
:sequence (:size (length (the equi-points)))
:center (nth (the-child index) (the equi-points))
:orientation (alignment :top (the centerline-arc (tangent (the-child center)))))
(start-circle :type 'circle
:radius (the minor-radius))
(centerline-arc :type 'arc
:start-angle 0
:end-angle (the :end-angle-normalized)
:radius (the :major-radius))))
| 9,163 | Common Lisp | .lisp | 141 | 41.29078 | 132 | 0.509706 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9d851eb191835bcb6a01431c9e5d3138c5de62356c1bbd680e977e37669fc9e9 | 35,747 | [
-1
] |
35,748 | outline-specialization-mixin.lisp | lisp-mirror_gendl/geom-base/wire/source/outline-specialization-mixin.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object outline-specialization-mixin (base-object)
:input-slots
((outline-objects (the hidden-children)))
:computed-slots
((local-box (bounding-box-from-list (the outline-objects)))
(outline-leaves (apply #'append
(mapcar #'(lambda(object)
(cond ((typep object 'outline-specialization-mixin)
(the-object object outline-leaves))
(t (list object))))
(the outline-objects))))))
| 1,492 | Common Lisp | .lisp | 32 | 37.8125 | 90 | 0.642412 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | e08eea6554597f1ff77ee33f4429851e9efce9577a065474f4a970e592474a6e | 35,748 | [
-1
] |
35,749 | cylinder.lisp | lisp-mirror_gendl/geom-base/wire/source/cylinder.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object cylinder (ifs-output-mixin arcoid-mixin base-object)
:documentation (:description "An extrusion of circular cross section in which the
centers of the circles all lie on a single line (i.e., a right circular cylinder).
Partial cylinders and hollow cylinders are supported."
:examples "<pre>
(in-package :gdl-user)
(define-object cylinder-sample (cylinder)
:computed-slots
((display-controls (list :color :pink-spicy))
(length 10)
(radius 3)
(number-of-sections 25)))
(generate-sample-drawing :objects (make-object 'cylinder-sample)
:projection-direction (getf *standard-views* :trimetric))
</pre>")
:input-slots ("Number. Distance from center of start cap to center of end cap."
length
"Number. Radius of the circular cross section of the cylinder."
radius
("Number. Radius of the hollow inner portion for a hollow cylinder."
inner-radius nil)
("Integer. Number of vertical sections to be drawn in wireframe rendering mode."
number-of-sections 8)
("Boolean. Determines whether to include bottom cap in shaded renderings. Defaults to T."
bottom-cap? t)
("Boolean. Determines whether to include bottom cap in shaded renderings. Defaults to T."
top-cap? t)
(radius-1 (the :radius))
(radius-2 (the :radius))
("Boolean. Indicates that a partial cylinder (or cone) should have a closed gap."
closed? nil)
(inner-radius-1 (the :inner-radius))
(inner-radius-2 (the :inner-radius))
(inner? nil)
(width (twice (the radius)))
(height (the width)))
:computed-slots
((%renderer-info% (list :vrml? t :view-default :trimetric))
(start-line (let* ((center (the :center))
(radius-1 (the :radius-1))
(radius-2 (the :radius-2))
(half-length (half (the :length)))
(start-arc-center (translate center :front half-length))
(end-arc-center (translate center :rear half-length))
(start-3-o-clock (translate start-arc-center :right radius-1))
(end-3-o-clock (translate end-arc-center :right radius-2)))
(list start-3-o-clock end-3-o-clock)))
(%lines-and-curves%
(let* ((center (the :center))
(radius-1 (the :radius-1))
(radius-2 (the :radius-2))
(half-length (half (the :length)))
(start-arc-center (translate center :front half-length))
(end-arc-center (translate center :rear half-length))
(start-3-o-clock (translate start-arc-center :right radius-1))
(end-3-o-clock (translate end-arc-center :right radius-2))
(front-vector (the (:face-normal-vector :front)))
(section-arc (/ (min (the :arc)(twice pi)) (the :number-of-sections)))
(arc (the arc))
(face-ht (the :%face-ht%))
result)
(list
(append (dotimes (count (the :number-of-sections) (nreverse result))
(push (list (rotate-point start-3-o-clock
start-arc-center
front-vector
:angle (* count section-arc))
(rotate-point end-3-o-clock
end-arc-center
front-vector
:angle (* count section-arc))) result))
(when (< (the :arc) (twice pi))
(append
(unless (the :inner?)
(cons (the :end-line) (the :radials)))
(unless (or (the :hollow?) (the :inner?))
(list (the :center-line)))))
(when (not (typep (the :inner-cylinder) 'null-part))
(the :inner-cylinder :%lines-to-draw%)))
(let ((end-arc-face-ht (make-hash-table :size 6)))
(setf (gethash :top end-arc-face-ht) (gethash :front face-ht)
(gethash :rear end-arc-face-ht) (gethash :top face-ht)
(gethash :right end-arc-face-ht) (gethash :right face-ht)
(gethash :left end-arc-face-ht) (gethash :left face-ht)
(gethash :bottom end-arc-face-ht) (gethash :rear face-ht)
(gethash :front end-arc-face-ht) (gethash :bottom face-ht))
(let ((end-arc-0-curves
(arc-curves end-arc-face-ht radius-1 (translate-along-vector center (gethash :front face-ht)
half-length)
0 arc))
(end-arc-1-curves
(arc-curves end-arc-face-ht radius-2 (translate-along-vector center (gethash :rear face-ht)
half-length)
0 arc)))
(append end-arc-0-curves end-arc-1-curves
(when (not (typep (the :inner-cylinder) 'null-part))
(the :inner-cylinder :%curves-to-draw%))))))))
(%curves-to-draw% (second (the :%lines-and-curves%)))
(%lines-to-draw% (first (the :%lines-and-curves%)))
("3D Point. The center of the start cap."
start (translate (the :center) :front (half (the :length))))
("3D Point. The center of the end cap."
end (translate (the :center) :rear (half (the :length))))
("3D Vector. Points from the start to the end."
direction-vector (subtract-vectors (the :end) (the :start)))
("Boolean. Indicates whether there is an inner-radius and thus the cylinder is hollow."
hollow? (or (the :inner-radius) (and (the :inner-radius-1) (the :inner-radius-2))))
;;
;; FLAG -- pull (the (:end-arcs [0,1]) [:start, :end]) from %curves-to-draw% above computed from function.
;;
(end-line (list (the (:end-arcs 0) :end) (the (:end-arcs 1) :end)))
(%arcs% (append (list-elements (the end-arcs))
(when (not (typep (the inner-cylinder) 'null-part))
(list-elements (the inner-cylinder end-arcs)))))
(radials (let ((hollow? (the :hollow?)))
(list (list (if hollow? (the :inner-cylinder (:end-arcs 0) :start)
(the :start)) (the (:end-arcs 0) :start))
(list (if hollow? (the :inner-cylinder (:end-arcs 0) :end)
(the :start)) (the (:end-arcs 0) :end))
(list (if hollow? (the :inner-cylinder (:end-arcs 1) :start)
(the :end)) (the (:end-arcs 1) :start))
(list (if hollow? (the :inner-cylinder (:end-arcs 1) :end)
(the :end)) (the (:end-arcs 1) :end)))))
(center-line (list (the (:end-arcs 0) :center) (the (:end-arcs 1) :center)))
(top-points (the (end-arcs 1) (equi-spaced-points (max (the number-of-sections) 12))))
(bottom-points (the (end-arcs 0) (equi-spaced-points (max (the number-of-sections) 12))))
(polygons-for-ifs (unless (the simple?)
;;
;; FLAG -- For cones at least: fill in with more intermediate arcs, to get better aspect triangles.
;;
(let ((top-points (the top-points))
(bottom-points (the bottom-points)))
(append (mapcar #'(lambda(p1 p2 p3 p4) (list p1 p2 p4 p3))
top-points bottom-points (rest top-points) (rest bottom-points))
(when (and (the top-cap?) (not (or (the hollow?) (the inner?)))) (list top-points))
(when (and (the bottom-cap?) (not (or (the hollow?) (the inner?)))) (list bottom-points))
(when (and (the closed?) (not (or (the hollow?) (the inner?))))
(list (list (first top-points)
(first bottom-points)
(lastcar bottom-points)
(lastcar top-points))))
(when (and (the hollow?) (not (the inner?)))
(mapcar #'list
top-points
(rest top-points)
(rest (the inner-cylinder top-points))
(the inner-cylinder top-points)))
(when (and (the hollow?) (not (the inner?)))
(mapcar #'list
bottom-points
(rest bottom-points)
(rest (the inner-cylinder bottom-points))
(the inner-cylinder bottom-points)))
(when (and (the hollow?) (not (the inner?)))
(list (list (first top-points)
(first (the inner-cylinder top-points))
(first (the inner-cylinder bottom-points))
(first bottom-points))
(list (lastcar top-points)
(lastcar (the inner-cylinder top-points))
(lastcar (the inner-cylinder bottom-points))
(lastcar bottom-points))))
(when (the hollow?) (the inner-cylinder polygons-for-ifs))))))
(simple? (and (not (the inner-radius))
(near-to? (the arc) 2pi)))
)
:hidden-objects
((inner-cylinder :type (cond ((and (the :inner-radius-1) (the :inner-radius-2))
(if (not (and (< (the inner-radius-1) (the radius-1))
(< (the inner-radius-2) (the radius-2))))
(error "inner radius not less than radius for ~a.~%"
(cons 'the (reverse (the root-path))))
'cone))
((the inner-radius)
(if (not (< (the inner-radius) (the radius)))
(error "inner radius not less than radius for ~a.~%"
(cons 'the (reverse (the root-path))))
'cylinder))
(t 'null-part))
:radius (the :inner-radius)
:radius-1 (the :inner-radius-1)
:radius-2 (the :inner-radius-2)
:inner? t
:pass-down (:number-of-sections :arc))
;;
;; FLAG -- remove this child part when FLAG above is addressed.
;;
(end-arcs :type 'arc
:sequence (:size 2)
:radius (ecase (the-child :index) (0 (the :radius-1)) (1 (the :radius-2)))
:orientation (alignment :top (the (:face-normal-vector :front))
:right (the (:face-normal-vector :right)))
:center (translate (the :center) (ecase (the-child :index)
(0 :front) (1 :rear)) (half (the :length)))
:start-angle 0
:end-angle (the :arc))))
| 11,927 | Common Lisp | .lisp | 217 | 39.714286 | 110 | 0.541849 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 625e978f671c08a91c8bd8edc57901bef0778035d1f20f967a6f62587c139726 | 35,749 | [
-1
] |
35,750 | route-pipe.lisp | lisp-mirror_gendl/geom-base/wire/source/route-pipe.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object global-filleted-polygon-projection-sample (global-filleted-polygon-projection)
:computed-slots
((display-controls (list :color :blue-steel :transparency 0.3 :shininess 0.7 :spectral-color :white))
(default-radius 5)
(projection-depth 5)
(vertex-list (list (make-point 0 0 0)
(make-point 10 10 0)
(make-point 30 10 0)
(make-point 40 0 0)
(make-point 30 -10 0)
(make-point 10 -10 0)
(make-point 0 0 0)))))
(define-object route-pipe (global-filleted-polyline-mixin outline-specialization-mixin)
:documentation
(:description "Defines an alternating set of cylinders and torus sections for the elbows"
:examples "<pre>
(in-package :gdl-user)
(define-object route-pipe-sample (base-object)
:objects
((pipe :type 'route-pipe
:vertex-list (list #(410.36 436.12 664.68)
#(404.21 436.12 734.97)
#(402.22 397.48 757.72)
#(407.24 397.48 801.12)
#(407.24 448.0 837.0)
#(346.76 448.0 837.0))
:default-radius 19
:outer-pipe-radius 7
:inner-pipe-radius nil
:display-controls (list :color :blue-steel
:transparency 0.0
:shininess 0.7
:spectral-color :white))))
(generate-sample-drawing :objects (the-object (make-object 'route-pipe-sample) pipe)
:projection-direction (getf *standard-views* :trimetric))
</pre>")
:input-slots
(("Number. Radius of the inner hollow part of the piping. NIL for a solid pipe."
inner-pipe-radius nil)
"Number. Radius to the outer surface of the piping."
outer-pipe-radius
"List of 3D Points. Same as for global-filleted-polyline (which is mixed in to this part)"
vertex-list)
:computed-slots
((%renderer-info% (list :vrml? t :view-default :trimetric))
(outline-objects (append (list-elements (the cylinders))
(list-elements (the tori))))
(bounding-box (let ((overage (the outer-pipe-radius)))
(let ((p1 (first (the polyline bounding-box)))
(p2 (second (the polyline bounding-box))))
(list (make-point (- (get-x p1) overage) (- (get-y p1) overage) (- (get-z p1) overage))
(make-point (+ (get-x p2) overage) (+ (get-y p2) overage) (+ (get-z p2) overage))))))
(length (the bounding-bbox length))
(width (the bounding-bbox width))
(height (the bounding-bbox height))
(orientation nil)
(torus-types (mapcar #'(lambda(test)
(if (the-object test valid?) 'torus 'null-part))
(list-elements (the fillet-tests))))
(pipe-parts (let ((cylinders (list-elements (the cylinders)))
(torii (let (result) (dotimes (n (the tori number-of-elements) (nreverse result))
(push (the (tori n)) result)))))
(remove-if #'(lambda(part) (typep part 'null-part))
(append (apply #'append (mapcar #'list cylinders torii))
(when (> (length cylinders) (length torii)) (last cylinders))))))
)
;;:hidden-objects
:objects
((polyline :type 'global-filleted-polyline
:pass-down (vertex-list default-radius))
(cylinders :type 'cylinder-with-straight
:sequence (:size (length (the straights)))
:straight (nth (the-child index) (the straights))
:radius (the outer-pipe-radius)
:inner-radius (the inner-pipe-radius)
:length (* 1 (3d-distance (first (the-child straight))
(second (the-child straight))) )
:center (mid-point (the-child straight))
:bottom-cap? (not (the-child first?))
:display-controls (append (list :solid? t) (the display-controls))
:top-cap? (not (the-child last?))
:orientation (alignment :front (direction-vector (the-child straight))))
(tori :type (:sequence (the torus-types))
:sequence (:size (the fillets number-of-elements))
:fillet (the (fillets (the-child index)))
:minor-radius (the outer-pipe-radius)
:major-radius (the-child fillet radius)
:inner-minor-radius (when (the inner-pipe-radius)
(the inner-pipe-radius))
:display-controls (append (list :solid? t) (the display-controls))
:center (the-child fillet center)
:orientation (alignment
:top (the-child fillet (face-normal-vector :top))
:right (rotate-vector (the-child fillet (face-normal-vector :right))
(the-child fillet start-angle-normalized)
(the-child fillet (face-normal-vector :top))))
:arc (- (the-child fillet end-angle-normalized) (the-child fillet start-angle-normalized)))))
(define-object cylinder-with-straight (cylinder)
:input-slots (straight))
| 6,638 | Common Lisp | .lisp | 120 | 39.758333 | 113 | 0.57097 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | d8eb9f7e58f7863eebad72a8985de389122a2c3494abe8321ff4b8ede47de01c | 35,750 | [
-1
] |
35,751 | bezier-curve.lisp | lisp-mirror_gendl/geom-base/wire/source/bezier-curve.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object bezier-curve (base-object)
:documentation
(:description "GDL currently supports third-degree Bezier curves, which are
defined using four 3D <i>control-points</i>. The Bezier curve always passes
through the first and last control points and lies within the convex hull of the control
points. At the start point (i.e. the first control point), the curve is tangent
to the vector pointing from the start point to the second control point.
At the end point (i.e. the last control point), the curve is tangent to the
vector pointing from the end point to the third control point."
:examples "<pre>
(in-package :gdl-user)
(define-object bezier-sample (bezier-curve)
:computed-slots
((control-points (list (make-point 0 0 0)
(make-point 1 1 0)
(make-point 2 1 0)
(make-point 3 0 0))))
:objects
((points-display :type 'points-display
:points (the control-points))))
(generate-sample-drawing :objects (let ((self (make-object 'bezier-sample)))
(list self (the points-display))))
</pre>")
:input-slots
("List of 4 3D Points. Specifies the control points for the Bezier curve."
control-points
(%reversed?% nil)
(weights nil)
(knots nil)
(degree nil)
)
:computed-slots
((start (first (the control-points)))
(end (lastcar (the control-points)))
(%curves-to-draw% (list (the control-points)))
(%renderer-info% (list :vrml? t :view-default :top))
(coefficients (destructuring-bind (p1 p2 p3 p4) (the control-points)
(let (c0 c1 c2 c3)
(let* ((a (scalar*vector -1 p1))
(b (scalar*vector 3 p2))
(c (scalar*vector -3 p3))
(d (add-vectors a (add-vectors b (add-vectors c p4)))))
(setq c3 (make-vector (get-x d) (get-y d) (get-z d))))
(let* ((a (scalar*vector 3 p1))
(b (scalar*vector -6 p2))
(c (scalar*vector 3 p3))
(d (add-vectors a (add-vectors b c))))
(setq c2 (make-vector (get-x d) (get-y d) (get-z d))))
(let* ((a (scalar*vector -3 p1))
(b (scalar*vector 3 p2))
(c (add-vectors a b)))
(setq c1 (make-vector (get-x c) (get-y c) (get-z c))
c0 (make-vector (get-x p1) (get-y p1) (get-z p1))))
(make-array 4 :initial-contents (list c3 c2 c1 c0)))))
(bounding-box (bounding-box-from-points (the control-points))))
:methods
(("List of 3D points. Returns points of intersection in the Z plane between this Bezier curve
and the infinite line containing point <tt>point</tt> and direction <tt>vector</tt>. Use the
between? function if you wish to establish whether the point is contained in a particular line
segment.
:arguments (line \"GDL line object.\")
:&key ((accuracy (* 10.0 double-float-epsilon)) \"Number. Target accuracy.\"
(maximum-number-of-iterations 30) \"Integer. Maximum iterations of polynomial solver.\")"
intersection-2D
((line line) &rest args)
(apply #'(lambda()
(the (line-intersection-2D (the-object line start) (the-object line direction-vector))))
args))
("List of 3D points. Returns points of intersection in the Z plane between this Bezier curve and
the circle in the Z plane with center <tt>center</tt> and radius <tt>radius</tt>.
:arguments (circle \"GDL circle object.\")
:&key ((accuracy (* 10.0 double-float-epsilon)) \"Number. Target accuracy.\"
(maximum-number-of-iterations 30) \"Integer. Maximum iterations of polynomial solver.\")"
intersection-2D
((circle circle) &rest args)
(apply #'(lambda()
(the (circle-intersection-2D (the-object circle center) (the-object circle radius))))
args))
("Throws error. This is the catch-all error method for 2D-intersection for unknown argument types."
intersection-2D
((unknown-object t) &rest args)
(declare (ignore args))
(error "Sorry, base GDL does not yet have a 2D intersection method for ~s and ~s.~%"
(the :type) (class-name (class-of (the-object unknown-object))))))
:hidden-objects
((reverse :type (if (the %reversed?%) 'null-object 'bezier-curve) :control-points (reverse (the control-points))
:%reversed?% t))
:functions
((b-spline-data
()
(values (the control-points) (the weights) (the knots) (the degree)))
(equi-spaced-points
(number &key (spacing :parametric))
(unless (eql spacing :parametric) (error "Equi-spaced-points for bezier-curve only supports :spacing :parametric."))
(unless (> number 1) (error "Equi-spaced-points must be called with a number greater than 1."))
(case spacing
(:parametric (let ((u1 0.0) (u2 1.0))
(let ((parameter-list (list-of-numbers u1 u2 (/ (- u2 u1) (1- number)))))
(mapcar #'(lambda(parameter) (the (point parameter))) parameter-list))))))
("3D Point. Returns the point on this Bezier curve corresponding to the given <tt>parameter</tt>,
which should be between 0 and 1.
:arguments (parameter \"Number. Curve parameter, between zero and one (0 and 1).\")"
point (parameter)
(let ((coefficients (the coefficients)))
(add-vectors (scalar*vector (* parameter parameter parameter) (elt coefficients 0))
(add-vectors (scalar*vector (* parameter parameter) (elt coefficients 1))
(add-vectors (scalar*vector parameter (elt coefficients 2))
(elt coefficients 3))))))
("List of 3D points. Returns points of intersection in the Z plane between this Bezier curve
and the infinite line containing point <tt>point</tt> and direction <tt>vector</tt>. Use the
between? function if you wish to establish whether the point is contained in a particular line
segment.
:arguments (point \"3D Point. Any point in the line to be intersected.\"
vector \"3D Vector. The direction of the line to be intersected.\")
:&key ((accuracy (* 10.0 double-float-epsilon)) \"Number. Target accuracy.\"
(maximum-number-of-iterations 30) \"Integer. Maximum iterations of polynomial solver.\")"
line-intersection-2D
(point vector &key (accuracy (* 10.0 double-float-epsilon))
(maximum-number-of-iterations 30))
(let* ((coefficients (the coefficients))
(cross (cross-vectors *nominal-z-vector* vector))
(p2 (translate-along-vector point vector (length-vector vector)))
(cl (- (* (get-x point) (get-y p2))
(* (get-x p2) (get-y point))))
(rotated-bezier (make-array
(list 4)
:initial-contents (list (dot-vectors cross (elt coefficients 0))
(dot-vectors cross (elt coefficients 1))
(dot-vectors cross (elt coefficients 2))
(+ (dot-vectors cross (elt coefficients 3)) cl)))))
(let ((parameters (get-zeroes-in-interval rotated-bezier 0 1 :accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations)))
(mapcar #'(lambda(parameter)
(the (point parameter))) parameters))))
("List of 3D points. Returns points of intersection in the Z plane between this Bezier curve and
the circle in the Z plane with center <tt>center</tt> and radius <tt>radius</tt>.
:arguments (center \"3D Point. The center of the circle to be intersected.\"
radius \"Number. The radius of the circle to be intersected.\")
:&key ((accuracy (* 10.0 double-float-epsilon)) \"Number. Target accuracy.\"
(maximum-number-of-iterations 30) \"Integer. Maximum iterations of polynomial solver.\")"
circle-intersection-2D
(center radius &key (accuracy (* 10.0 double-float-epsilon))
(maximum-number-of-iterations 30))
(let* ((rr (* radius radius))
(coefficients (the coefficients))
(c3 (aref coefficients 0))
(c2 (aref coefficients 1))
(c1 (aref coefficients 2))
(c0 (aref coefficients 3))
(polynomial
(make-array (list 7)
:initial-contents (list (+ (* (get-x c3) (get-x c3) rr)
(* (get-y c3) (get-y c3) rr))
(twice (+ (* (get-x c3) (get-x c2) rr)
(* (get-y c3) (get-y c2) rr)))
(+ (twice (+ (* (get-x c3) (get-x c1) rr)
(* (get-y c3) (get-y c1) rr)))
(* (get-x c2) (get-x c2) rr)
(* (get-y c2) (get-y c2) rr))
(+ (twice (* (get-x c3) rr
(- (get-x c0) (get-x center))))
(twice (* (get-y c3) rr
(- (get-y c0) (get-y center))))
(twice (+ (* (get-x c2) (get-x c1) rr)
(* (get-y c2) (get-y c1) rr))))
(+ (twice (* (get-x c2) rr
(- (get-x c0) (get-x center))))
(twice (* (get-y c2) rr
(- (get-y c0) (get-y center))))
(* (get-x c1) (get-x c1) rr)
(* (get-y c1) (get-y c1) rr))
(+ (twice (* (get-x c1) rr
(- (get-x c0) (get-x center))))
(twice (* (get-y c1) rr
(- (get-y c0) (get-y center)))))
(+ (* (get-x c0) (get-x c0) rr)
(- (twice (* (get-y c0) (get-y center) rr)))
(- (twice (* (get-x c0) (get-x center) rr)))
(* (get-y c0) (get-y c0) rr)
(* (get-x center) (get-x center) rr)
(* (get-y center) (get-y center) rr)
(- (* rr rr)))))))
(mapcar #'(lambda(param)
(the (point param)))
(get-zeroes-in-interval polynomial 0 1 :accuracy accuracy
:maximum-number-of-iterations maximum-number-of-iterations))))))
| 12,700 | Common Lisp | .lisp | 207 | 43.019324 | 121 | 0.518882 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 236c0d56c70a71a6cf6fe1afe7ae44abafdf7bf92f24327e0315f0773b117d6c | 35,751 | [
-1
] |
35,752 | global-polyline.lisp | lisp-mirror_gendl/geom-base/wire/source/global-polyline.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object global-polyline-mixin (base-object)
:documentation (:description "Makes a connected polyline with vertices connected by straight line segments.")
:input-slots
("List of 3D Points. The vertices (``corners'') of the polyline."
vertex-list)
:computed-slots
((%corners% (bounding-box-from-points (the vertex-list)))
(%lines-to-draw% (the :lines))
(%%vertex-array%% (flatten-lines (the %lines-to-draw%)))
(%%line-vertex-indices%% (let ((count -1))
(mapcar #'(lambda(line)
(declare (ignore line))
(list (incf count) (incf count)))
(the %lines-to-draw%))))
(path-info (append (list :move (first (the vertex-list)))
(mapcan #'(lambda(point) (list :line point))
(rest (the vertex-list)))))
(%renderer-info% (list :vrml? t :view-default :top))
("List of pairs of 3D points. Each pair represents the start and end of each line segment in the polyline."
lines (let ((vertex-list (the vertex-list)))
(mapcar #'list vertex-list (rest vertex-list))))
(vertex-list-local (mapcar #'(lambda(vertex) (the (global-to-local vertex))) (the vertex-list)))
(invariant-component (let ((vertex-list (the vertex-list-local)))
(cond ((every #'near-to? (mapcar #'get-x vertex-list)
(mapcar #'get-x (rest vertex-list))) :x)
((every #'near-to? (mapcar #'get-y vertex-list)
(mapcar #'get-y (rest vertex-list))) :y)
((every #'near-to? (mapcar #'get-z vertex-list)
(mapcar #'get-z (rest vertex-list))) :z))))
(profile-origin (when (the invariant-component)
(the (global-to-local
(let ((normal (the (face-normal-vector (ecase (the invariant-component)
(:x :right) (:y :rear) (:z :top))))))
(inter-line-plane (the center) normal (first (the vertex-list)) normal))))))
(bounding-box (bounding-box-from-points (the vertex-list))))
:functions
(
;;
;; FLAG -- generalize this
;;
(interpolated-points-2d
()
(let ((points (mapcar #'(lambda(point) (the (global-to-local point)))
(the (:interpolated-points)))))
(let ((first-component (ecase (the :invariant-component) (:x #'get-y) ((:y :z) #'get-x)))
(second-component (ecase (the :invariant-component) ((:x :y) #'get-z) (:z #'get-y))))
(mapcar #'(lambda(point)
(make-point (funcall first-component point) (funcall second-component point)))
points))))
(interpolated-points
(&optional (curve-chords *curve-chords*))
(declare (ignore curve-chords))
(append (mapcar #'(lambda(line) (first line)) (the lines)) (last (lastcar (the lines)))))))
(define-object global-polyline (global-polyline-mixin)
:documentation (:description "A sequence of points connected by straight line segments. Please see
global-polyline-mixin for documentation on the messages."
:examples "<pre>
(in-package :gdl-user)
(define-object global-polyline-sample (global-polyline)
:computed-slots
((vertex-list (list (make-point 0 0 0)
(make-point 10 10 0)
(make-point 30 10 0)
(make-point 40 0 0)
(make-point 30 -10 0)
(make-point 10 -10 0)
(make-point 0 0 0)))))
(generate-sample-drawing :objects (make-object 'global-polyline-sample))
</pre>"))
| 4,797 | Common Lisp | .lisp | 90 | 41.188889 | 111 | 0.584385 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 74b4548af45f6b01b7ea9e875a03caa0f4b570b33d0c9b4b75732842cfdd919e | 35,752 | [
-1
] |
35,754 | line-and-arc-constraints.lisp | lisp-mirror_gendl/geom-base/wire/source/line-and-arc-constraints.lisp | ;;
;; Copyright 2012 Genworks International and Liberating Insight
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object constrained-line (line)
:documentation (:description "This object is intended to simplify the process of
constructing lines using various constraints. Currently supported
are 2 through-points or 1 through-point and at-angle. Note the
line-constraints must be an evaluatable s-expression as this is not
processed as a macro")
:input-slots
(line-constraints)
:computed-slots
((trim-start (getf (the line-constraints) :trim-start))
(trim-end (getf (the line-constraints) :trim-end))
(constraints (let ((lst (the line-constraints)))
(dolist (key (list :trim-start :trim-end) lst)
(setq lst (remove-plist-key lst key)))))
(keys (plist-keys (the constraints)))
(exprs (plist-values (the constraints)))
(constraint-type
(cond ((every #'(lambda (key)
(eql :through-point key))
(the keys))
:2-points)
((and (getf (the constraints) :through-point)
(getf (the constraints) :at-angle))
:point-angle)
((and (getf (the constraints) :tangent-to)
(getf (the constraints) :at-angle))
:tangent-angle)
((let ((keys (the keys)))
(and (= (length keys) 3)
(= (count :tangent-to keys) 1) (= (count :through-point keys) 1)
(= (count :side-vector keys) 1)))
:tangent-through-point)
((= (count :tangent-to (the keys)) 2)
;:tangent-tangent
(error "ICAD COMPAT line-constrains for keys tangent-to and tangent-to not yet implemented"))
(t (error "Constrained-Line -- constraint configuration is not yet supported"))))
(start (if (the trim-start)
(proj-point-on-line (the trim-start)
(the constraint-object start)
(the constraint-object direction-vector))
(the constraint-object start)))
(end (if (the trim-end)
(proj-point-on-line (the trim-end)
(the constraint-object start)
(the constraint-object direction-vector))
(the constraint-object end))))
:hidden-objects
((constraint-object :type (case (the constraint-type)
(:2-points 'line-constraints-2-points)
(:point-angle 'line-constraints-point-angle)
(:tangent-angle 'line-constraints-tangent-angle)
(:tangent-through-point 'line-constraints-tangent-through-point))
:constraints (the constraints)))
:functions
(("Icad Compat function"
tangent-point (constraint-index)
(when (member (the constraint-type) (list :tangent-angle :tangent-tangent))
(case constraint-index
(0 (the constraint-object start))
(1 (the constraint-object end)))))
(angle-at-tangent-point
(constraint-index)
(declare (ignore constraint-index))
(error "The ICAD COMPAT function Angle-at-tangent-point has not been implemented"))))
(define-object line-constraints-2-points ()
:input-slots
(constraints)
:computed-slots
((start (nth 1 (the constraints)))
(end (nth 3 (the constraints)))
(direction-vector (subtract-vectors (the end) (the start)))))
(define-object line-constraints-point-angle (base-object)
:input-slots
(constraints)
:computed-slots
((start (let ((pos (position :through-point (the constraints))))
(nth (1+ pos) (the constraints))))
(at-angle (let ((pos (position :at-angle (the constraints))))
(nth (1+ pos) (the constraints))))
(angle-key (getf (the at-angle) :angle))
(angle (case (the angle-key)
((:normal :perpendicular) pi/2)
(:parallel 0)
(t (the angle-key)))) ;; angle-key could simply be a number
(reference-vector (or (getf (the at-angle) :reference-vector)
(the (face-normal-vector :right))))
(length (getf (the at-angle) :length))
(plane-normal (or (getf (the at-angle) :plane-normal)
(the (face-normal-vector :top))))
(translation-vector (rotate-vector (the reference-vector)
(the angle)
(the plane-normal)))
(end (translate-along-vector
(the start) (the translation-vector) (the length)))
(direction-vector (the reference-vector))))
(define-object line-constraints-tangent-angle (base-object)
:input-slots
(constraints)
:computed-slots
(;;------------- Break out the constraint keywords --------------
(tangent-to-expr (getf (the constraints) :tangent-to))
(arc (getf (the tangent-to-expr) :arc))
(arc-geometry (getf (the tangent-to-expr) :arc-geometry))
(arc-center (if (the arc-geometry)
(getf (the arc-geometry) :center)
(the arc center)))
(arc-radius (if (the arc-geometry)
(getf (the arc-geometry) :radius)
(the arc radius)))
(arc-side-vector (if (the arc-geometry)
(getf (the arc-geometry) :side-vector)
(getf (the tangent-to-expr) :side-vector)))
(arc-plane-normal (if (the arc-geometry)
(getf (the arc-geometry) :side-vector)
(the arc (face-normal-vector :top))))
(at-angle-expr (getf (the constraints) :at-angle))
(angle (getf (the at-angle-expr) :angle))
(length (getf (the at-angle-expr) :length))
(reference-vector (getf (the at-angle-expr) :reference-vector))
;;;----------- Calculation ----------------------------------
(circle-intersection-vector (cross-vectors (the arc-plane-normal)
(the reference-vector)))
(start (inter-line-sphere (the arc-center)
(the circle-intersection-vector)
(the arc-center)
(the arc-radius)
(the arc-side-vector)))
(end (translate-along-vector (the start)
(the reference-vector)
(the length)))
(direction-vector (the reference-vector))))
(define-object line-constraints-tangent-through-point (base-object)
:input-slots
(constraints)
:computed-slots
(;;------------- Break out the constraint keywords --------------
(through-point (getf (the constraints) :through-point))
(tangent-to-expr (getf (the constraints) :tangent-to))
(arc (getf (the tangent-to-expr) :arc))
(arc-geometry (getf (the tangent-to-expr) :arc-geometry))
(arc-center (if (the arc-geometry)
(getf (the arc-geometry) :center)
(the arc center)))
(arc-radius (if (the arc-geometry)
(getf (the arc-geometry) :radius)
(the arc radius)))
(side-vector (getf (the constraints) :side-vector))
(arc-plane-normal (if (the arc-geometry)
(getf (the arc-geometry) :side-vector)
(the arc (face-normal-vector :top))))
;;;----------- Calculation ----------------------------------
(new-circle-center (midpoint (the arc-center) (the through-point)))
(end-1 (inter-circle-circle (the arc-center) (the arc-radius)
(the new-circle-center) (3d-distance (the new-circle-center) (the arc-center))
t))
(end-2 (inter-circle-circle (the arc-center) (the arc-radius)
(the new-circle-center) (3d-distance (the new-circle-center) (the arc-center))
nil))
(start (the through-point))
(end-1-angle-between (angle-between-vectors (the side-vector)
(subtract-vectors (the end-1) (the arc-center))
(the (face-normal-vector :top))
:-ve t))
(end-2-angle-between (angle-between-vectors (the side-vector)
(subtract-vectors (the end-2) (the arc-center))
(the (face-normal-vector :top))
:-ve t))
(end (if (< (the end-1-angle-between) (the end-2-angle-between))
(the end-1) (the end-2)))))
(defun reverse-plist (plist)
(let (result)
(mapc #'(lambda(key value)
(push value result)
(push key result))
(plist-keys plist) (plist-values plist)) result))
(define-object constrained-arc (arc)
:documentation
(:description
"This object is intended to simplify the process of
constructing lines using various constraints. Currently supported
are 2 through-points or 1 through-point and at-angle. Note the
line-constraints must be an evaluatable s-expression as this is not
processed as a macro")
:input-slots
(arc-constraints)
:computed-slots
((center (the constraint-object center))
(radius (the constraint-object radius))
(orientation (the constraint-object orientation))
(first-tangent-index (position :tangent-to (plist-keys (the arc-constraints))))
(second-tangent-index (position :tangent-to (plist-keys (the arc-constraints)) :from-end t))
(constraint-type
(let ((constraints (the arc-constraints)))
(cond ((let ((first-tangent (getf (the arc-constraints) :tangent-to))
(second-tangent (getf (reverse-plist (the arc-constraints)) :tangent-to))
(radius (getf (the arc-constraints) :radius)))
(or
(and (eql (first first-tangent) :arc-geometry)
(eql (first second-tangent) :line-geometry) radius)
(and (eql (first first-tangent) :line-geometry)
(eql (first second-tangent) :arc-geometry) radius)))
:tangent-arc-tangent-line-radius)
((and (getf plist :tangent-to)(getf plist :center-on)(getf plist :through-point) (getf plist :select-side))
:tangent-to--center-on--through-point--select-side)
((let ((keys (plist-keys (the arc-constraints))))
(and (= (length keys) 3) (= (count :through-point keys) 2) (= (count :tangent-to keys) 1)))
:tangent-to-through-two-points)
((equalp (plist-keys (the arc-constraints)) '(:through-point :through-point :through-point))
:through-three-points)
((and (getf constraints :center) (getf constraints :radius) (getf constraints :plane-normal))
:center-radius-plane-normal)
(t (error "Constrained-arc --- constraint configuration is not yet supported"))))))
:hidden-objects
((constraint-object :type (ecase (the constraint-type)
(:tangent-arc-tangent-line-radius
'arc-constraints-tangent-arc-tangent-line-radius)
(:through-three-points
'arc-constraints-through-three-points)
(:tangent-to-through-two-points
'arc-constraint-tangent-to-through-two-points)
(:center-radius-plane-normal
'arc-constraint-center-radius-plane-normal)
(:tangent-to--center-on--through-point--select-side
'arc-constraint-tangent-to--center-on--through-point--select-side))
:pass-down (first-tangent-index)
:constraints (the arc-constraints)))
:functions
((tangent-point
(constraint-index)
(the constraint-object (tangent-point constraint-index)))))
(define-object constrained-fillet (constrained-arc)
:documentation
(:description
"This object is the same as constrained-arc, but it is only
meaningful for arc-constraints which contain two :tangent-to clauses,
and it automatically trims the result to each point of tangency")
:computed-slots
((angle-0 0)
(angle-1 (angle-between-vectors (subtract-vectors (the (tangent-point (the first-tangent-index))) (the center))
(subtract-vectors (the (tangent-point (the second-tangent-index))) (the center))
(the (face-normal-vector :top))
:-ve t))
(start-angle (min (the angle-0) (the angle-1)))
(end-angle (max (the angle-0) (the angle-1)))))
(define-object constrained-arc-base-mixin (base-object)
:input-slots (constraints center radius))
(define-object arc-constraint-tangent-to--center-on--through-point--select-side (constrained-arc-base-mixin)
)
(define-object arc-constraint-center-radius-plane-normal (constrained-arc-base-mixin)
:computed-slots ((center (getf (the constraints) :center))
(radius (getf (the constraints) :radius))
(orientation (alignment :top (getf (the constraints) :plane-normal)))))
(define-object arc-constraint-tangent-to-through-two-points (base-object)
:input-slots (constraints first-tangent-index) ;; first-tangent-index is ignored for this case.
:computed-slots ((point-P (getf (the constraints) :through-point))
(point-Q (getf (reverse-plist (the constraints)) :through-point))
(tangent-to (getf (the constraints) :tangent-to))
(tangent-to-line (getf (the tangent-to) :line)) ;; FLAG -- add arc/circle case.
(tangent-to-side-vector (getf (the tangent-to) :side-vector))
(P-Q-vector (subtract-vectors (the point-Q) (the point-P)))
(parallel-case? (parallel-vectors? (the tangent-to-line direction-vector) (the P-Q-vector)))
(point-T (when (the parallel-case?)
(let ((bisector-point (midpoint (the point-P) (the point-Q)))
(bisector-vector (cross-vectors (the P-Q-vector) (the (face-normal-vector :top)))))
(inter-line-line bisector-point bisector-vector
(the tangent-to-line start) (the tangent-to-line direction-vector)))))
(point-G (unless (the parallel-case?)
(inter-line-line (the point-P) (the P-Q-vector)
(the tangent-to-line start) (the tangent-to-line direction-vector))))
(circle-C-center (midpoint (the point-P) (the point-Q)))
(circle-C-radius (3d-distance (the circle-C-center) (the point-P)))
(center (if (the parallel-case?)
(the parallel-case-arc center)
(the constrained-circle center)))
(radius (if (the parallel-case?)
(the parallel-case-arc radius)
(the constrained-circle radius)))
(point-A (the tangent-line end))
(circle-D-center (the point-G))
(circle-D-radius (3d-distance (the point-G) (the point-A)))
(point-T1 (inter-line-sphere (the tangent-to-line start)
(the tangent-to-line direction-vector)
(the circle-D-center)
(the circle-D-radius)
(the tangent-to-side-vector))))
:objects ((parallel-case-arc :type (if (the parallel-case?) 'constrained-arc 'null-object)
:arc-constraints (list :through-point (the point-P)
:through-point (the point-Q)
:through-point (the point-T)))
(tangent-line :type 'constrained-line
:line-constraints (list :through-point (the point-G)
:tangent-to (list :arc-geometry
(list :center (the circle-C-center)
:radius (the circle-C-radius)))
:side-vector (cross-vectors (subtract-vectors (the point-G)
(the circle-C-center))
(the (face-normal-vector :top)))))
(constrained-circle :type 'constrained-arc
:arc-constraints (list :through-point (the point-P)
:through-point (the point-Q)
:through-point (the point-T1)))))
(define-object arc-constraints-through-three-points (base-object)
:input-slots (constraints first-tangent-index ;; first-tangent-index is ignored for this case.
(length-backoff 99/100))
:hidden-objects ((sphere-a :type 'sphere :radius (* 1/20 (the radius)) :center (the point-a))
(sphere-b :type 'sphere :radius (* 1/20 (the radius)) :center (the point-b))
(sphere-c :type 'sphere :radius (* 1/20 (the radius)) :center (the point-c)))
:computed-slots ((point-a (getf (the constraints) :through-point))
(point-b (getf (rest (rest (the constraints))) :through-point))
(point-c (getf (rest (rest (rest (rest (the constraints))))) :through-point))
(a-b-length (3d-distance (the point-a) (the point-b)))
(a-b-vector (subtract-vectors (the point-b) (the point-a)))
(a-b-bisector-start (midpoint (the point-a) (the point-b)))
(a-b-bisector-vector (cross-vectors (the a-b-vector) (the (face-normal-vector :top))))
(b-c-length (3d-distance (the point-b) (the point-c)))
(b-c-vector (subtract-vectors (the point-c) (the point-b)))
(b-c-bisector-start (midpoint (the point-b) (the point-c)))
(b-c-bisector-vector (cross-vectors (the b-c-vector) (the (face-normal-vector :top))))
(center (inter-line-line (the a-b-bisector-start) (the a-b-bisector-vector)
(the b-c-bisector-start) (the b-c-bisector-vector)))
(radius (3d-distance (the center) (the point-a)))))
(define-object arc-constraints-tangent-arc-tangent-line-radius (base-object)
:input-slots (constraints first-tangent-index)
:computed-slots ((radius (getf (the constraints) :radius))
(tangent-specs (list (getf (the constraints) :tangent-to)
(getf (reverse-plist (the constraints)) :tangent-to)))
(arc-geometry (second (find :arc-geometry (the tangent-specs) :key #'first)))
(line-geometry (second (find :line-geometry (the tangent-specs) :key #'first)))
(orientation
(alignment :top (getf (the arc-geometry) :plane-normal)
:right (subtract-vectors (the (tangent-point (the first-tangent-index)))
(the center))))
(line-normal (cross-vectors (getf (the line-geometry) :direction-vector)
(getf (the arc-geometry) :plane-normal)))
(active-sphere (the (spheres (if (getf (the arc-geometry) :inside?) 0 1))))
(active-line (the (parallels
(if (or (null (getf (the line-geometry) :side-vector))
(< (angle-between-vectors
(the line-normal)
(getf (the line-geometry) :side-vector))
pi/2)) 0 1))))
(select-side (or (getf (the constraints) :select-side)
(getf (the line-geometry) :direction-vector)))
(center (inter-line-sphere (the active-line start)
(the active-line direction-vector)
(the active-sphere center)
(the active-sphere radius)
(the select-side))))
:objects ((constraint-objects :type
'arc-constraints-tangent-arc-tangent-line-radius-constraint-object
:sequence (:size (length (plist-keys (the constraints))))
:key (nth (the-child index) (plist-keys (the constraints)))
:value (nth (the-child index) (plist-values (the constraints)))
:result-center (the center)
:result-radius (the radius)
:reference-object (cond ((and (eql (the-child key)
:tangent-to)
(eql (first (the-child value))
:line-geometry))
(the-child reference-line))
((and (eql (the-child key)
:tangent-to)
(eql (first (the-child value))
:arc-geometry))
(the-child reference-arc))
(t nil))
:reference-line (the reference-line)
:reference-arc (the reference-arc))
(reference-arc :type 'arc
:center (getf (the arc-geometry) :center)
:radius (getf (the arc-geometry) :radius))
(reference-line :type 'line
:start (getf (the line-geometry) :line-point)
:end (translate-along-vector (the-child start)
(getf (the line-geometry) :direction-vector)
(the radius)))
(parallels :type 'line
:sequence (:size 2)
:start (translate-along-vector (getf (the line-geometry) :line-point)
(ecase (the-child index)
(0 (the line-normal))
(1 (reverse-vector (the line-normal))))
(the radius))
:end (translate-along-vector (the-child start)
(getf (the line-geometry) :direction-vector)
(getf (the arc-geometry) :radius)))
(spheres :type 'sphere
:sequence (:size 2)
:center (getf (the arc-geometry) :center)
:radius (funcall (ecase (the-child index)
(0 #'-) (1 #'+))
(getf (the arc-geometry) :radius) (the radius))))
:functions ((tangent-point
(constraint-index)
(the (constraint-objects constraint-index) tangent-point))))
(define-object arc-constraints-tangent-arc-tangent-line-radius-constraint-object (base-object)
:input-slots (key value reference-object reference-line reference-arc result-center result-radius)
:computed-slots ((tangent-point (etypecase (the reference-object)
(line (inter-line-plane
(the reference-line start)
(the reference-line direction-vector)
(the result-center)
(the reference-line direction-vector)))
(arc (inter-line-sphere
(the reference-arc center)
(subtract-vectors (the result-center)
(the reference-arc center))
(the reference-arc center)
(the reference-arc radius)
(subtract-vectors (the result-center)
(the reference-arc center))
))))))
(define-object test-arc (base-object)
:objects ((arc :type 'constrained-arc
:arc-constraints (list :through-point (make-point 0 0 0)
:through-point (make-point 1 0 0)
:through-point (make-point 2 1 0))
:radius 10 :center (make-point 0 0 0)
:end-angle (the-child (angle-at-point (make-point 0 1 0))))))
(define-object test-constrained-arc-2 (constrained-arc)
:computed-slots
((arc-constraints (list :tangent-to (list :line (the tangent-line) :side-vector (make-vector -1 0 0))
:through-point (make-point -15 5 0)
:through-point (make-point 15 5 0))))
:hidden-objects ((tangent-line :type 'line
:start (make-point -15 0 0)
:end (make-point 15 1 0))
(sphere-P :type 'sphere
:radius 1
:center (the constraint-object point-P))
(sphere-Q :type 'sphere
:radius 1
:center (the constraint-object point-Q))))
(define-object test-constrained-arc (constrained-arc)
:computed-slots
((arc-constraints (list :tangent-to
(list :arc-geometry
(list :center (the circle center)
:radius (the circle radius)
:plane-normal (the circle (face-normal-vector :top))
:inside? t))
:tangent-to (list :line-geometry
(list :line-point (the line start)
:direction-vector
(unitize-vector (the line direction-vector))
:side-vector (make-vector -1 0 0)
))
:radius 3)))
:objects ((arc-tangent-point :type 'point
:center (the (tangent-point 0)))
(line-tangent-point :type 'point
:center (the (tangent-point 1)))
#+nil
(pts :type 'point
:display-controls (list :color :blue)
:sequence (:size 50)
:center (translate-along-vector (the center)
(rotate-vector
(the (face-normal-vector :right))
(* (the-child index)
(div 2pi (the-child aggregate
number-of-elements)))
(the (face-normal-vector :top)))
(the radius)))
#+nil
(circ-pts :type 'point
:display-controls (list :color :red)
:sequence (:size 200)
:center (translate-along-vector (the circle center)
(rotate-vector
(the (face-normal-vector :right))
(* (the-child index)
(div 2pi (the-child
aggregate number-of-elements)))
(the (face-normal-vector :top)))
(the circle radius)))
(line :type 'line
:start (make-point 1 1 0)
:end (translate-along-vector (the-child start)
(make-vector 0 1 0)
10))
(circle :type 'arc
:center (make-point 0 0 0)
:start-angle (angle-between-vectors (the-child (face-normal-vector :right))
(subtract-vectors (the (tangent-point 0))
(the center))
(the (face-normal-vector :top))
:-ve t)
:end-angle 0
:orientation (alignment :top (make-vector 0 0 1))
:radius 10)))
| 24,480 | Common Lisp | .lisp | 509 | 39.683694 | 114 | 0.634961 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 227463f375885fa9ad8dbc99cf000af8c64286cec1ffcac1578ff067317d5d2f | 35,754 | [
-1
] |
35,755 | point-light.lisp | lisp-mirror_gendl/geom-base/wire/source/point-light.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
;;
;; This was moved to vrml.lisp in the lenses directory, might put
;; the point-light object itself back in here since it can be rendered
;; not only in vrml.
;;
| 1,148 | Common Lisp | .lisp | 26 | 38.384615 | 71 | 0.740019 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 8fa61c210d23d769ce9db12cf923e02ed8839dfcfce1cff9bb4e5192d555296a | 35,755 | [
-1
] |
35,756 | arcoid-mixin.lisp | lisp-mirror_gendl/geom-base/wire/source/arcoid-mixin.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object arcoid-mixin ()
:documentation (:description "This object is a low level object used to define
an arc like object. It is not recommended to be used directly by GDL common users.
For developers it should be used as a mixin.")
:input-slots
("Number. Distance from center to any point on the arc."
radius
(arc 2pi)
("Angle in radians. Start angle of the arc. Defaults to zero."
start-angle 0)
("Angle in radians. End angle of the arc. Defaults to twice pi."
end-angle (the arc)))
:computed-slots
((angles-normalized (the (normalize-start-end (the start-angle) (the end-angle))))
(start-angle-normalized (apply #'min (the angles-normalized)))
(end-angle-normalized (apply #'max (the angles-normalized)))
(start-to-end-angle (- (the end-angle-normalized) (the start-angle-normalized)))
(total-length (* (the radius) (the start-to-end-angle)))
(%arcs% (list self)))
:functions
((normalize-start-end
(start-angle end-angle)
(let* ((start-angle-normalized (when start-angle (mod start-angle 2pi)))
(end-angle-normalized (when end-angle
(let ((nominal (mod end-angle 2pi)))
(if (or (zerop nominal)
(< nominal start-angle-normalized))
(+ nominal 2pi) nominal)))))
(list start-angle-normalized end-angle-normalized)))))
| 2,371 | Common Lisp | .lisp | 50 | 40.7 | 84 | 0.676496 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | bfd91a7caccfbfb76fe8e3892057880e1605b6340d1b2ed456a26da048b47310 | 35,756 | [
-1
] |
35,757 | utilities.lisp | lisp-mirror_gendl/geom-base/wire/source/utilities.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(defun bounding-box-from-list (objects &key (local-objects))
(let ((object-boxes (remove nil (mapcar #'(lambda(object) (when (typep object 'base-object)
(the-object object bounding-box))) objects)))
(local-object-boxes (remove nil (mapcar #'(lambda(object) (when (typep object 'base-object)
(the-object object local-box)))
local-objects))))
(let (xmin ymin zmin xmax ymax zmax)
(mapcar #'(lambda(box)
(let ((min (first box)) (max (second box)))
(let ((x-min (get-x min)) (y-min (get-y min)) (z-min (get-z min))
(x-max (get-x max)) (y-max (get-y max)) (z-max (get-z max)))
(when (or (null xmin) (< x-min xmin)) (setq xmin x-min))
(when (or (null ymin) (< y-min ymin)) (setq ymin y-min))
(when (or (null zmin) (< z-min zmin)) (setq zmin z-min))
(when (or (null xmax) (> x-max xmax)) (setq xmax x-max))
(when (or (null ymax) (> y-max ymax)) (setq ymax y-max))
(when (or (null zmax) (> z-max zmax)) (setq zmax z-max)))))
(append local-object-boxes object-boxes))
(if xmin
(list (make-point xmin ymin zmin) (make-point xmax ymax zmax))
(list (make-point 0 0 0) (make-point 0 0 0))))))
(defun bounding-box-from-points (points)
(let (xmin ymin zmin xmax ymax zmax)
(mapcar #'(lambda(point)
(let ((x (get-x point)) (y (get-y point)) (z (get-z point)))
(when (or (null xmin) (< x xmin)) (setq xmin x))
(when (or (null ymin) (< y ymin)) (setq ymin y))
(when (or (null zmin) (< z zmin)) (setq zmin z))
(when (or (null xmax) (> x xmax)) (setq xmax x))
(when (or (null ymax) (> y ymax)) (setq ymax y))
(when (or (null zmax) (> z zmax)) (setq zmax z)))) points)
(list (make-point xmin ymin zmin) (make-point xmax ymax zmax))))
| 3,053 | Common Lisp | .lisp | 53 | 45.660377 | 107 | 0.558971 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 3e6fba1affbc13e73a719bd9036ca9840bd77e043e3bce11c65bc3f11f0ea580 | 35,757 | [
-1
] |
35,758 | null-geometric-object.lisp | lisp-mirror_gendl/geom-base/wire/source/null-geometric-object.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object null-geometric-object ())
| 932 | Common Lisp | .lisp | 22 | 39.954545 | 71 | 0.744469 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | b678b7f39acffc6767eda3bcd0d8bcd77045ff183e9a0213b84694d831e940f7 | 35,758 | [
-1
] |
35,759 | points-display.lisp | lisp-mirror_gendl/geom-base/wire/source/points-display.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object points-display (outline-specialization-mixin)
:documentation
(:description "Product a list of hidden-children which are GDL point objects, which
will be displayed in normal renderings using the <tt>outline-specialization-mixin</tt> mechanism.")
:input-slots ("List of 3D points (i.e. vectors). The points to be displayed." points)
:computed-slots ((points-array (make-array (length (the points))
:initial-contents (the points))))
:hidden-objects
((display-points :type 'point
:sequence (:size (length (the points)))
:center (aref (the points-array) (the-child index)))))
| 1,597 | Common Lisp | .lisp | 32 | 44.1875 | 100 | 0.702265 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | dbce1759087d174b3b7224ba3fadede2d69df8fd07e3274dfa0397f2140ab230 | 35,759 | [
-1
] |
35,760 | sphere.lisp | lisp-mirror_gendl/geom-base/wire/source/sphere.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object sphere (ifs-output-mixin arcoid-mixin base-object)
:documentation (:description "The set of points equidistant from a given center point."
:examples "<pre>
(in-package :gdl-user)
(define-object sphere-sample (sphere)
:computed-slots
((radius 150)
(number-of-vertical-sections 10)
(number-of-horizontal-sections 10)
(display-controls (list :color :green-forest-medium))))
(generate-sample-drawing :objects (make-object 'sphere-sample)
:projection-direction :trimetric)
</pre>")
:input-slots ("Number. Distance from center to any point on the sphere." radius
("Angle in radians. Starting horizontal angle for a partial sphere. Default is 0."
start-horizontal-arc 0)
("Angle in radians. Starting vertical angle for a partial sphere. Default is -pi/2."
start-vertical-arc (- pi/2))
("Angle in radians. Ending horizontal angle for a partial sphere. Default is twice pi."
end-horizontal-arc 2pi)
("Angle in radians. Ending vertical angle for a partial sphere. Default is pi/2."
end-vertical-arc pi/2)
("Number. Radius of inner hollow for a hollow sphere. Default is NIL, for a non-hollow sphere."
inner-radius nil)
("Number. How many lines of latitude to show on the sphere in some renderings. Default value is 4."
number-of-horizontal-sections 8)
("Number. How many lines of longitude to show on the sphere in some renderings. Default value is 4."
number-of-vertical-sections 8)
(inner? nil))
:computed-slots
((length (twice (the radius)))
(width (twice (the radius)))
(height (twice (the radius)))
(%renderer-info% (list :vrml? t :view-default :trimetric))
(parallel-and-meridian-curves
(let* ((center (the :center))
(radius (the :radius))
(face-ht (the :%face-ht%))
(right-vector (gethash :right face-ht))
(front-vector (gethash :front face-ht))
(top-vector (gethash :top face-ht))
(vertical-arcs (the (normalize-start-end (the start-vertical-arc)
(the end-vertical-arc))))
(start-vertical-arc (first vertical-arcs))
(end-vertical-arc (second vertical-arcs))
(horizontal-arcs (the (normalize-start-end (the start-horizontal-arc)
(the end-horizontal-arc))))
(start-horizontal-arc (first horizontal-arcs))
(end-horizontal-arc (second horizontal-arcs))
(parallel-angle (the :parallel-angle))
(parallel-curves (let (result)
(dotimes (index (1- (the :number-of-vertical-sections)) result)
(let* ((local-center
(let* ((ray (rotate-vector right-vector
(+ start-vertical-arc
(* parallel-angle (1+ index)))
front-vector))
(sphere-point (inter-line-sphere center ray
center radius ray)))
(inter-line-plane center top-vector sphere-point top-vector)))
(radius (3d-distance local-center
(inter-line-sphere local-center
right-vector
center
radius
right-vector))))
(let ((new-curves (arc-curves face-ht radius local-center start-horizontal-arc
end-horizontal-arc)))
(if result (nconc result new-curves) (setq result new-curves)))))))
(meridian-curves (let (result
(horizontal-start-to-end-angle (the :horizontal-start-to-end-angle))
(number-of-horizontal-sections (the :number-of-horizontal-sections)))
(dotimes (index (1+ (the :number-of-horizontal-sections)) result)
(let ((face-ht
(make-face-ht
(alignment
:top
(rotate-vector front-vector
(+ start-horizontal-arc
(* index
(/ horizontal-start-to-end-angle
number-of-horizontal-sections)))
top-vector)
:rear (the (:face-normal-vector :top))))))
(let ((new-curves (arc-curves face-ht radius center start-vertical-arc
end-vertical-arc)))
(if result (nconc result new-curves) (setq result new-curves))))))))
(list :parallels parallel-curves :meridian-curves meridian-curves)))
(%curves-to-draw%
(append
(when (the :inner-radius) (the :inner-sphere :%curves-to-draw%))
(getf (the parallel-and-meridian-curves) :meridian-curves)
(getf (the parallel-and-meridian-curves) :parallels)))
(horizontal-start-to-end-angle (- (the :end-horizontal-arc)(the :start-horizontal-arc)))
(vertical-start-to-end-angle (- (the :end-vertical-arc) (the :start-vertical-arc)))
(parallel-angle (/ (the vertical-start-to-end-angle) (the number-of-vertical-sections)))
(horizontal-increment-angle (/ (the horizontal-start-to-end-angle) (the number-of-horizontal-sections)))
(simple? nil #+nil
(and (not (the inner-radius))
(near-to? (the start-horizontal-arc) 0)
(near-to? (the end-horizontal-arc) 2pi)
(near-to? (the start-vertical-arc) (- pi/2))
(near-to? (the end-vertical-arc) pi/2)))
(polygon-points (let ((right-vector (the (face-normal-vector :right)))
result)
(dotimes (m (1+ (the number-of-horizontal-sections)) result)
(let* ((tangent-vector (rotate-vector right-vector
(+ (the start-horizontal-arc)
(* m (the horizontal-increment-angle)))
(the (face-normal-vector :top))))
(normal-vector (cross-vectors tangent-vector (the (face-normal-vector :top))))
inner-result)
(dotimes (n (1+ (the number-of-vertical-sections)))
(let ((ray (rotate-vector tangent-vector
(+ (the start-vertical-arc)
(* n (the parallel-angle)))
normal-vector)))
(push (inter-line-sphere (the center) ray
(the center) (the radius) ray) inner-result)))
(push inner-result result)))))
(polygons-for-ifs (unless nil ;;(the simple?)
(append
(apply #'append
(mapcar #'(lambda(list1 list2)
(mapcar #'(lambda(p1 p2 p3 p4)
(list p1 p2 p4 p3))
list1 (rest list1) list2 (rest list2)))
(the polygon-points) (rest (the polygon-points))))
(when (and (the inner-radius) (not (the inner?)))
(mapcar #'(lambda (p1 p2 p3 p4)
(list p1 p2 p4 p3))
(first (the polygon-points))
(first (the inner-sphere polygon-points))
(rest (first (the polygon-points)))
(rest (first (the inner-sphere polygon-points)))))
(when (and (the inner-radius) (not (the inner?)))
(mapcar #'(lambda (p1 p2 p3 p4)
(list p1 p2 p4 p3))
(lastcar (the polygon-points))
(lastcar (the inner-sphere polygon-points))
(rest (lastcar (the polygon-points)))
(rest (lastcar (the inner-sphere polygon-points)))))
(when (and (the inner-radius) (not (the inner?)))
(mapcar #'(lambda (p1 p2 p3 p4)
(list p1 p2 p4 p3))
(mapcar #'first (the polygon-points))
(mapcar #'first (the inner-sphere polygon-points))
(rest (mapcar #'first (the polygon-points)))
(rest (mapcar #'first (the inner-sphere polygon-points)))))
(when (and (the inner-radius) (not (the inner?)))
(mapcar #'(lambda (p1 p2 p3 p4)
(list p1 p2 p4 p3))
(mapcar #'lastcar (the polygon-points))
(mapcar #'lastcar (the inner-sphere polygon-points))
(rest (mapcar #'lastcar (the polygon-points)))
(rest (mapcar #'lastcar (the inner-sphere polygon-points)))))
(when (the inner-radius) (the inner-sphere polygons-for-ifs))))))
:hidden-objects
((inner-sphere :type (if (the :inner-radius) 'sphere 'null-part)
:radius (the :inner-radius)
:pass-down (start-horizontal-arc
start-vertical-arc end-horizontal-arc
end-vertical-arc
number-of-horizontal-sections
number-of-vertical-sections)
:inner? t
:inner-radius nil)))
| 11,083 | Common Lisp | .lisp | 188 | 39.260638 | 117 | 0.52035 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 6d21ae178ead425715384d7b89356d3080d790e4d3af5d9688235bf840c1b88b | 35,760 | [
-1
] |
35,761 | point.lisp | lisp-mirror_gendl/geom-base/wire/source/point.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
;;
;; FLAG -- change the rendering of this to scale-independent crosshairs.
;;
(define-object point (sphere)
:documentation (:description "Visual representation of a point as a small view-independent crosshair. This means
the crosshair will always appear in a ``top'' view regardless of the current view transform. The crosshair will
not scale along with any zoom state unless the <tt>scale?</tt> optional input-slot is non-NIL. The default
color for the crosshairs is a light grey (:grey-light-very in the *color-table*)."
:examples "<pre>
(in-package :gdl-user)
(define-object point-sample (base-object)
:objects
((bezier :type 'bezier-curve
:control-points (list (make-point 0 0 0)
(make-point 1 1 0)
(make-point 2 1 0)
(make-point 3 0 0)))
(points-to-show :type 'point
:sequence (:size (length (the bezier control-points)))
:center (nth (the-child :index)
(the bezier control-points))
:radius 0.08
:display-controls (list :color :blue))))
(generate-sample-drawing :object-roots (make-object 'point-sample))
</pre>")
:input-slots
(("Boolean. Indicates whether the crosshairs drawn to represent the point are scaled along with
any zoom factor applied to the display, or are fixed with respect to drawing space. The default is NIL,
meaning the crosshairs will remain the same size regardless of zoom state."
scaled? nil)
(radius 0)
("Number. Distance from center to end of crosshairs used to show the point. Default value is 3."
crosshair-length 3)
(color-key (getf (the display-controls) :color :grey-light-very)))
:computed-slots
((%curves-to-draw% nil)
(%renderer-info% (list :vrml? t :view-default :top))
(%corners% (if (the scaled?)
(list (the (vertex :top :right :rear))
(the (vertex :bottom :left :front)))
(list (translate (the center) :right 1 :rear 1 :top 1)
(translate (the center) :left 1 :front 1 :bottom 1))))
(bounding-box (let ((x (get-x (the center)))
(y (get-y (the center)))
(z (get-z (the center))))
(bounding-box-from-points (list (make-point (- x 1) (- y 1) (- z 1))
(make-point (+ x 1) (+ y 1) (+ z 1))))))))
(define-lens (pdf point)()
:output-functions
((cad-output
()
(with-format-slots (view)
(let ((center (if view (the-object view (view-point (the center))) (the center)))
(view-scale (if (and view (the scaled?)) (the-object view view-scale) 1)))
(let ((start-x (- (get-x center) (* (the crosshair-length) view-scale)))
(start-y (- (get-y center) (* (the crosshair-length) view-scale))))
(pdf:with-saved-state
(write-the line-thickness-setting)
(write-the rgb-stroke-setting)
(pdf:move-to (to-single-float start-x) (to-single-float (get-y center)))
(pdf:line-to (to-single-float (+ start-x (* (twice (the crosshair-length)) view-scale)))
(to-single-float (get-y center)))
(pdf:move-to (to-single-float (get-x center))
(to-single-float start-y))
(pdf:line-to (to-single-float (get-x center))
(to-single-float (+ start-y (* (twice (the crosshair-length)) view-scale))))
(pdf:stroke))))))))
(define-lens (pdf vector)()
:output-functions
((cad-output
()
(with-format-slots (view)
(let ((center (if view (the-object view (view-point self)) self))
(crosshair-length 3) ;; FLAG -- figure out better way to specify this
;;(view-scale (if view (the-object view view-scale) 1))
(view-scale 1)
)
(let ((start-x (- (get-x center) (* crosshair-length view-scale)))
(start-y (- (get-y center) (* crosshair-length view-scale))))
(pdf:with-saved-state
(pdf:move-to (to-single-float start-x) (to-single-float (get-y center)))
(pdf:line-to (to-single-float (+ start-x (* (twice crosshair-length) view-scale)))
(to-single-float (get-y center)))
(pdf:move-to (to-single-float (get-x center))
(to-single-float start-y))
(pdf:line-to (to-single-float (get-x center))
(to-single-float (+ start-y (* (twice crosshair-length) view-scale))))
(pdf:stroke)))))))) | 5,798 | Common Lisp | .lisp | 109 | 41.458716 | 115 | 0.588605 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | a13a0916f4f6e9113b4fc7d96f4da8f543bee3f543be32f797c239ac6f3f6414 | 35,761 | [
-1
] |
35,762 | base-object.lisp | lisp-mirror_gendl/geom-base/wire/source/base-object.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(glisp:define-constant +identity-lh-matrix+ (alignment :top (make-vector 0 0 1)
:left (make-vector 1 0 0)
:rear (make-vector 0 1 0)))
;;
;; FLAG -- consider name change to something indicating that this is geometric.
;;
(define-object base-object ()
:documentation
(:description "Base-Object is a superclass of most of GDL's geometric primitives. It
provides an imaginary geometric reference box with a length, width, height, center,
and orientation."
:examples
"<pre>
(in-package :gdl-user)
(define-object tower (base-object)
:input-slots
((number-of-blocks 50) (twist-per-block 1)
(block-height 1) (block-width 5) (block-length 7))
:objects
((blocks :type 'box
:sequence (:size (the number-of-blocks))
:center (translate (the center)
:up (* (the-child index)
(the-child height)))
:width (the block-width)
:height (the block-height)
:length (the block-length)
:orientation (alignment
:rear (if (the-child first?)
(rotate-vector-d (the (face-normal-vector :rear))
(the twist-per-block)
(the (face-normal-vector :top)))
(rotate-vector-d (the-child previous
(face-normal-vector :rear))
(the twist-per-block)
(the (face-normal-vector :top))))
:top (the (face-normal-vector :top))))))
;;
;;Test run
;;
#|
gdl-user(46): (setq self (make-object 'tower))
#tower @ #x750666f2
gdl-user(47): (setq test-center (the (blocks 10) center))
#(0.0 0.0 10.0)
gdl-user(48): (the (blocks 10) (global-to-local test-center))
#(0.0 0.0 0.0)
gdl-user(49): (the (blocks 10) (local-to-global (the (blocks 10)
(global-to-local test-center))))
#(0.0 0.0 10.0)
gdl-user(50):
gdl-user(50): (setq test-vertex (the (blocks 10) (vertex :top :right :rear)))
#(1.7862364748012536 3.9127176305081863 10.5)
gdl-user(51): (the (blocks 10) (global-to-local test-vertex))
#(2.500000000000001 3.500000000000001 0.5)
gdl-user(52): (the (blocks 10) (local-to-global (the (blocks 10)
(global-to-local test-vertex))))
#(1.786236474801254 3.9127176305081877 10.5)
gdl-user(53):
|#
;;
;;
;;
</pre>" )
:input-slots
(("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 support this functionality, e.g. SVG/Raphael and X3DOM."
onclick-function nil)
("Pathname or string. Points to a pre-existing image file to be displayed instead of actual geometry for this object. Defaults to nil" image-file nil)
("Number. X-axis dimension of the reference box. Defaults to zero."
width 0 :defaulting)
("Number. Y-axis dimension of the reference box. Defaults to zero."
length 0 :defaulting)
("Number. Z-axis dimension of the reference box. Defaults to zero."
height 0 :defaulting)
("3D Point. Indicates in global coordinates where the center of the reference
box of this object should be located."
center (make-point 0 0 0) :defaulting)
("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 <i>orthonormal</i> matrix, meaning each row is a vector with a magnitude
of one (1.0).
"
orientation nil :defaulting)
(left-handed? (and (the orientation) (minusp (determinant (the orientation)))))
(orientation* (if (the left-handed?)
(matrix:multiply-matrix (the orientation) +identity-lh-matrix+)
(the orientation)))
(local-left-handed? (and (the local-orientation) (minusp (determinant (the local-orientation)))))
(%orientation% nil)
("3x3 Orthonormal Matrix of Double-Float Numbers. This is synonymous with the <tt>orientation</tt>."
obliqueness (the orientation))
("Plist. May contain keywords and values indicating display characteristics for
this object. The following keywords are recognized currently:
<dl>
<dt>:color</dt>
<dd> color keyword from the *color-table* parameter, or an HTML-style hexidecimal
RGB string value, e.g. \"#FFFFFF\" for pure white. Defaults to :black.</dd>
<dt>:line-thickness</dt>
<dd> an integer, defaulting to 1, indicating relative line thickness for wireframe
representations of this object.</dd>
<dt>:dash-pattern</dt>
<dd>(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.</dd>
</dl>"
display-controls nil :defaulting)
("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."
local-box (let ((vertices (let (vertices) (dolist (lateral '(:left :right) vertices)
(dolist (longitudinal '(:front :rear))
(dolist (vertical '(:bottom :top))
(push (the (vertex lateral longitudinal vertical)) vertices)))))))
(let (xmin ymin zmin xmax ymax zmax)
(mapc #'(lambda(vertex)
(let ((x (get-x vertex)) (y (get-y vertex)) (z (get-z vertex)))
(when (or (null xmin) (< x xmin)) (setq xmin x))
(when (or (null xmax) (> x xmax)) (setq xmax x))
(when (or (null ymin) (< y ymin)) (setq ymin y))
(when (or (null ymax) (> y ymax)) (setq ymax y))
(when (or (null zmin) (< z zmin)) (setq zmin z))
(when (or (null zmax) (> z zmax)) (setq zmax z)))) vertices)
(list (make-point xmin ymin zmin) (make-point xmax ymax zmax)))))
("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."
bounding-box (bounding-box-from-list (the children) :local-objects (when (the use-local-box?) (list self))))
(use-local-box? (not (and (zerop (the length))
(zerop (the width))
(zerop (the height)))))
(viewpoints nil)
(background-color (getf *colors-default* :background))
)
:trickle-down-slots
(:length :height :width :center :orientation :display-controls :line-thickness :use-local-box?)
:computed-slots
(("3D Point. The center of this object, from the perspective of the parent. Starting
from the parent's center and using the parent's orientation, this is the relative center
of this object.
"
local-center (the (convert-point-to-local (the center)))
)
("3D Point. The center of this object, from the perspective of the parent. Starting
from the parent's center and using the parent's orientation, this is the relative center
of this object.
"
local-center* (the (convert-point-to-local* (the center)))
)
(%dimension-mapping% (let ((dimensions (list :width :length :height)))
(swap-dimensions dimensions (the %orientation%))) :uncached)
(%true-width% (first (the %dimension-mapping%)) :uncached)
(%true-length% (second (the %dimension-mapping%)) :uncached)
(%true-height% (third (the %dimension-mapping%)) :uncached)
(%local-width% (the (evaluate (the %true-width%))) :uncached)
(%local-length% (the (evaluate (the %true-length%))) :uncached)
(%local-height% (the (evaluate (the %true-height%))) :uncached)
(vrml-center (the local-center))
("3x3 Matrix of Double-Float Numbers. Indicates the local Rotation Matrix used
to create the coordinate system of this object. This is the ``local''
orientation with respect to the parent. Multiplying the parent's orientation
with this matrix will always result in the absolute orientation for this part.
:note An orientation of NIL indicates the 3x3 identity matrix.
"
local-orientation (let ((parent-inverse
(when (and (the parent)
(the parent orientation))
(matrix:transpose-matrix (the parent orientation)))))
(if parent-inverse
(matrix:multiply-matrix (the orientation) parent-inverse)
(the orientation))))
(local-orientation* (let ((parent-inverse
(when (and (the parent)
(the parent orientation*))
(matrix:transpose-matrix (the parent orientation*)))))
(if (and parent-inverse (the orientation*))
(matrix:multiply-matrix (the orientation*) parent-inverse)
(the orientation*))))
;;
;; FLAG -- replace face hash tables with struct since it's always
;; the same 6 fields.
;;
(%face-ht% (let* ((orientation (the :orientation))
(ob-key
(when orientation
(list (aref orientation 0 0) (aref orientation 0 1)
(aref orientation 0 2) (aref orientation 1 0)
(aref orientation 1 1) (aref orientation 1 2)
(aref orientation 2 0) (aref orientation 2 1)
(aref orientation 2 2)))))
(or (gethash ob-key *standard-face-hts*)
(let ((ht (make-hash-table :size 6)))
(dolist (face (list :right :rear :top))
(setf (gethash face ht)
(if orientation
(array-to-3d-vector (matrix:multiply-matrix
(ecase
face
(:right *nominal-x-array*)
(:rear *nominal-y-array*)
(:top *nominal-z-array*))
orientation))
(ecase face
(:right *nominal-x-vector*)
(:rear *nominal-y-vector*)
(:top *nominal-z-vector*)))))
(setf (gethash :left ht) (reverse-vector (gethash :right ht))
(gethash :front ht) (reverse-vector (gethash :rear ht))
(gethash :bottom ht) (reverse-vector (gethash :top ht)))
(glisp:w-o-interrupts
(setf (gethash ob-key *standard-face-hts*)
ht))))))
("Vector of three real numbers. The RBG color of this object specified in :display-controls.
Defaults to the foreground color specified in <tt>*colors-default*</tt>. This message should not normally be overridden in user application code."
color-decimal (lookup-color (getf (the display-controls) :color)))
;;
;; FLAG -- remove this defunct version.
;;
#+nil
("Vector of three real numbers. The RBG color of this object specified in :display-controls.
Defaults to the foreground color specified in <tt>*colors-default*</tt>. This message should not normally be overridden in user application code."
color-decimal (multiple-value-bind (result found?)
(lookup-color (getf (the display-controls) :color))
(when found? result)))
(fill-color-decimal (multiple-value-bind (result found?)
(lookup-color (getf (the display-controls) :fill-color) :ground :background)
(when found? result)))
(line-thickness (getf (the display-controls) :line-thickness *line-thickness-default*))
(dash-pattern (getf (the display-controls) :dash-pattern))
(ui-display-list-objects nil)
;;
;; FLAG -- The following information is a catch-all until each
;; primitive computes more efficient info.
;;
(%vertex-array% (append (flatten-lines (the %lines-to-draw%))
(flatten-curves (the %curves-to-draw%))))
(%corners% nil)
(%line-vertex-indices% (let ((count -1))
(mapcar #'(lambda(line)
(declare (ignore line))
(list (incf count) (incf count)))
(the %lines-to-draw%))))
(%curve-vertex-indices% (let ((count (or (lastcar (lastcar (the %line-vertex-indices%))) -1)))
(mapcar #'(lambda(curve)
(declare (ignore curve))
(list (incf count) (incf count) (incf count) (incf count)))
(the %curves-to-draw%))))
(%renderer-info% nil)
(%internal-hidden-object-keywords% (append (list :local-bbox
:bounding-bbox
:beziers)
(call-next-method)))
(half-width (half (the width)) )
(half-length (half (the length)))
(half-height (half (the height)))
)
:hidden-objects
(("GDL object of type Box. A box representing the local-box."
local-bbox :type 'bounding-box
:display-controls (list :color :grey :transparency 0.7)
:corners (the local-box))
("GDL object of type Box. A box representing the bounding-box."
bounding-bbox
:type 'bounding-box
:display-controls (list :color :grey :transparency 0.7)
:corners (the bounding-box))
(beziers :type (if (the %curves-to-draw%) 'bezier-curve 'null-part)
:sequence (:size (length (the %curves-to-draw%)))
:control-points (nth (the-child index) (the %curves-to-draw%))))
:functions
(
(path-info ())
;;
;; FLAG -- check if we are at root orientation and center,
;; i.e. confirm transform is really necessary.
;;
("
3D-point. This function returns the point given in global coordinates, into relative local coordinates,
based on the orientation and center of the object to which the global-to-local message is sent.
:arguments (point \"3D-point. The point to be converted to local coordinates\")
:examples Please see the examples area."
global-to-local
(point)
(let ((point (if (the orientation) (matrix*vector (the orientation) point) point))
(center (if (the orientation) (matrix*vector (the orientation) (the center)) (the center))))
(subtract-vectors point center)))
(global-to-local*
(point)
(let ((point (if (the orientation*) (matrix*vector (the orientation*) point) point))
(center (if (the orientation*) (matrix*vector (the orientation*) (the center)) (the center))))
(subtract-vectors point center)))
("3D-point. This function returns the point given in relative local coordinates, converted into global coordinates,
based on the orientation and center of the object to which the local-to-global message is sent.
:arguments (point \"3D-point. The local point to be converted to global coordinates\")
:examples Please see the examples area.
"
local-to-global
(point)
(translate (the center) :right (get-x point) :rear (get-y point) :up (get-z point)))
(local-to-global*
(point)
(translate (the center) :right (get-x point) :rear (- (get-y point)) :up (get-z point)))
(convert-point-to-local
(point)
(let ((point
(let* ((parent-orientation
(when (the parent) (the parent orientation)))
(parent-center (when (the parent) (the parent center)))
(point-transformed
(if parent-orientation
(matrix*vector parent-orientation point)
point))
(parent-center-transformed
(when (the parent)
(if parent-orientation
(matrix*vector parent-orientation parent-center)
parent-center))))
(if parent-center-transformed
(subtract-vectors point-transformed
parent-center-transformed)
point-transformed))))
point))
(convert-point-to-local*
(point)
(let ((point
(let* ((parent-orientation
(when (the parent) (the parent orientation*)))
(parent-center (when (the parent) (the parent center)))
(point-transformed
(if parent-orientation
(matrix*vector parent-orientation point)
point))
(parent-center-transformed
(when (the parent)
(if parent-orientation
(matrix*vector parent-orientation parent-center)
parent-center))))
(if parent-center-transformed
(subtract-vectors point-transformed
parent-center-transformed)
point-transformed))))
point))
(distance-along-axis
(axis point &key (from (the center)))
(let ((u-plane-1 (ecase axis
((:front :rear :longitudinal :right :left :lateral) (the (face-normal-vector :top)))
((:top :bottom :vertical) (the (face-normal-vector :rear)))))
(u-plane-2 (ecase axis
((:front :rear :longitudinal :top :bottom :vertical) (the (face-normal-vector :right)))
((:right :left :lateral) (the (face-normal-vector :rear)))))
(p-plane (the center)))
(let ((start (inter-line-plane point u-plane-1 p-plane u-plane-1))
(end (inter-line-plane from u-plane-1 p-plane u-plane-1)))
(let ((start (inter-line-plane start u-plane-2 p-plane u-plane-2))
(end (inter-line-plane end u-plane-2 p-plane u-plane-2)))
(3d-distance start end)))))
(parallel-dimension
(vector)
(cond ((or (same-direction-vectors? vector (the (face-normal-vector :right)))
(same-direction-vectors? vector (the (face-normal-vector :left)))) (the width))
((or (same-direction-vectors? vector (the (face-normal-vector :rear)))
(same-direction-vectors? vector (the (face-normal-vector :front)))) (the length))
((or (same-direction-vectors? vector (the (face-normal-vector :top)))
(same-direction-vectors? vector (the (face-normal-vector :bottom)))) (the height))))
(parallel-coordinate
(vector)
(cond ((or (same-direction-vectors? vector (make-vector 1 0 0))
(same-direction-vectors? vector (make-vector -1 0 0))) :x)
((or (same-direction-vectors? vector (make-vector 0 1 0))
(same-direction-vectors? vector (make-vector 0 -1 0))) :y)
((or (same-direction-vectors? vector (make-vector 0 0 1))
(same-direction-vectors? vector (make-vector 0 0 -1))) :z)))
(coordinate-key
(direction)
(the (parallel-coordinate (the (face-normal-vector direction)))))
(translate
(origin offsets)
(if (null offsets) origin
(the (translate (translate-along-vector origin
(the (:face-normal-vector (ecase (first offsets)
((:up :top) :top)
((:down :bottom) :bottom)
(:left :left)
(:right :right)
(:front :front)
((:rear :back) :rear))))
(second offsets))
(rest (rest offsets))))))
(translate-center
(&rest specs)
(ecase (length specs)
(2 (translate (the center) (first specs) (second specs)))
(4 (translate (the center) (first specs) (second specs) (third specs) (fourth specs)))
(6 (translate (the center) (first specs) (second specs) (third specs) (fourth specs)
(fifth specs) (sixth specs)))))
(quantify-distance
(direction &key (reference-box (the quantify-box)))
(let ((cardinality (the aggregate number-of-elements))
(fill-distance (the-object reference-box (evaluate (ecase direction
(:lateral :width)
(:longitudinal :length)
(:vertical :height)))))
(local-distance (the (evaluate (ecase direction
(:lateral :%local-width%)
(:longitudinal :%local-length%)
(:vertical :%local-height%))))))
(let* ((span (- fill-distance local-distance))
(spacing (/ span (1- cardinality)))
(start (- (half span))))
(+ start (* spacing (the index))))))
("List of four 3D points. Returns the vertices of the indicated face.
:arguments (direction \"Direction keyword, e.g. :top, :bottom etc. Indicates for which face to return the vertices.\")
"
face-vertices
(direction)
(ecase direction
(:top (list (the (vertex :top :right :rear))
(the (vertex :top :right :front))
(the (vertex :top :left :front))
(the (vertex :top :left :rear))))
(:bottom (list (the (vertex :bottom :right :rear))
(the (vertex :bottom :right :front))
(the (vertex :bottom :left :front))
(the (vertex :bottom :left :rear))))
(:rear (list (the (vertex :rear :top :right))
(the (vertex :rear :top :left))
(the (vertex :rear :bottom :left))
(the (vertex :rear :bottom :right))))
(:front (list (the (vertex :front :top :right))
(the (vertex :front :top :left))
(the (vertex :front :bottom :left))
(the (vertex :front :bottom :right))))
(:right (list (the (vertex :right :top :rear))
(the (vertex :right :top :front))
(the (vertex :right :bottom :front))
(the (vertex :right :bottom :rear))))
(:left (list (the (vertex :left :top :rear))
(the (vertex :left :top :front))
(the (vertex :left :bottom :front))
(the (vertex :left :bottom :rear))))))
("Boolean. Returns non-nil if the given point is in halfspace defined by the plane given a point and direction.
:arguments (point \"3D point. a point in the plane\"
direction \"3D vector. The normal of the plane\")
"
in-face?
(point direction)
(when point
(let ((vectors (mapcar #'(lambda(vertex)(subtract-vectors vertex point))
(the (face-vertices direction)))))
(let ((angles (mapcar #'angle-between-vectors
vectors (append (rest vectors) (list (first vectors))))))
(when (near-to? (apply #'+ angles) 2pi) point)))))
("List of 3D points. Returns the points of intersection between given line and the reference box of this object.
:arguments (p-line \"3D point. A point in the line\"
u-line \"3D vector. The direction vector of the line\")
"
line-intersection-points
(p-line u-line)
(let ((top (the (in-face? (inter-line-plane p-line u-line
(the (face-center :top))
(the (face-normal-vector :top))) :top)))
(bottom (the (in-face? (inter-line-plane p-line u-line
(the (face-center :bottom))
(the (face-normal-vector :bottom))) :bottom)))
(left (the (in-face? (inter-line-plane p-line u-line
(the (face-center :left))
(the (face-normal-vector :left))) :left)))
(right (the (in-face? (inter-line-plane p-line u-line
(the (face-center :right))
(the (face-normal-vector :right))) :right)))
(front (the (in-face? (inter-line-plane p-line u-line
(the (face-center :front))
(the (face-normal-vector :front))) :front )))
(rear (the (in-face? (inter-line-plane p-line u-line
(the (face-center :rear))
(the (face-normal-vector :rear))) :rear))))
(sort (remove nil (list top bottom left right front rear))
#'(lambda(p1 p2) (< (3d-distance p-line p1)(3d-distance p-line p2)))))))
:functions
(
;;
;; FLAG -- performance -- if %face-ht% always has unit vectors pass optional T arg into translate-along-vector.
;;
("3D Point. Returns the center of the requested face of this object's reference box.
:arguments (direction \"Keyword. One of the standard direction keywords: :right, :left, :rear, :front, :top, :bottom.\")"
face-center
(direction)
(translate-along-vector (the :center) (gethash direction (the :%face-ht%))
(ecase direction
((:top :bottom) (the half-height))
((:left :right) (the half-width))
((:front :rear) (the half-length)))))
("3D Point. Returns the center of the requested edge of this object's reference box.
:arguments (direction-1 \"Keyword. One of the standard direction keywords: :right, :left, :rear, :front, :top, :bottom.\"
direction-2 \"Keyword. A standard direction keyword orthogonal to direction-1.\")"
edge-center
(direction-1 direction-2)
(translate-along-vector (the (:face-center direction-1))
(gethash direction-2 (the :%face-ht%))
(ecase direction-2
((:top :bottom) (the half-height))
((:left :right) (the half-width))
((:front :rear) (the half-length)))))
("3D Point. Returns the center of the requested vertex (corner) of this object's reference box.
:arguments (direction-1 \"Keyword. One of the standard direction keywords: :right, :left, :rear, :front, :top, :bottom.\"
direction-2 \"Keyword. A standard direction keyword orthogonal to direction-1.\"
direction-3 \"Keyword. A standard direction keyword orthogonal to direction-1 and direction-2.\")"
vertex
(direction-1 direction-2 direction-3)
(translate-along-vector (the (:edge-center direction-1 direction-2))
(gethash direction-3 (the :%face-ht%))
(ecase direction-3
((:top :bottom) (the half-height))
((:left :right) (the half-width))
((:front :rear) (the half-length)))))
("3D Vector. Returns the vector pointing in the positive direction of the specified axis of this object's reference box.
:arguments (axis \"Keyword. One of the standard axis keywords: :lateral, :longitudinal, :vertical.\")"
axis-vector
(axis)
(let ((orientation (the :orientation)))
(ecase axis
(:lateral
(if orientation
(array-to-3d-vector (multiply-matrices *nominal-x-array* orientation))
*nominal-x-vector*))
(:longitudinal
(if orientation
(array-to-3d-vector (multiply-matrices *nominal-y-array* orientation))
*nominal-y-vector*))
(:vertical
(if orientation
(array-to-3d-vector (multiply-matrices *nominal-z-array* orientation))
*nominal-z-vector*)))))
("3D Vector. Returns the vector pointing from this object's reference box center to its requested face-center.
:arguments (axis \"Keyword. One of the standard direction keywords: :right, :left, :rear, :front, :top, :bottom.\")"
face-normal-vector
(direction)
(gethash direction (the :%face-ht%)))
(%lines-to-draw%
nil
nil)
(%curves-to-draw%
nil
nil)
(%arcs% nil nil)
(fill-color-hex
()
(let* ((display-controls (find-in-hash self *display-controls*))
(fill-color-decimal (getf display-controls :fill-color-decimal))
(fill-color-decimal (or fill-color-decimal (coerce (the fill-color-decimal) 'list))))
(when (or fill-color-decimal (getf (the display-controls) :fill-color))
(lookup-color (or fill-color-decimal (getf (the display-controls) :fill-color)) :format :hex))))
(color-hex
()
(let* ((display-controls (find-in-hash self *display-controls*))
(color-decimal (getf display-controls :color-decimal))
(color-decimal (or color-decimal (coerce (or (the color-decimal)
(format-slot foreground-color)
(lookup-color (the color-decimal))) 'list))))
(lookup-color color-decimal :format :hex)))))
(define-object base-geometry-object (base-object))
(define-object base-coordinate-system (base-object)
:documentation (:description "This provides a default 3D Cartesian
coordinate system. It mixes in base-object and does not extend it
in any way, so as with base-object, it provides an imaginary
geometric reference box with a length, width, height, center, and
orientation."))
(define-object bounding-box (box)
:input-slots (corners)
:computed-slots
(
(orientation nil)
(lower-left (first (the corners))) (upper-right (second (the corners)))
(center (make-point (+ (get-x (the lower-left)) (half (the width)))
(+ (get-y (the lower-left)) (half (the length)))
(+ (get-z (the lower-left)) (half (the height)))))
(width (- (get-x (the upper-right)) (get-x (the lower-left))))
(length (- (get-y (the upper-right)) (get-y (the lower-left))))
(height (- (get-z (the upper-right)) (get-z (the lower-left))))))
(defun find-in-hash (object hash)
(when hash
(or (gethash object hash)
(let ((parent (the-object object parent)))
(when parent (find-in-hash parent hash))))))
(defun swap-dimensions (dimensions symbolic)
(cond ((null symbolic) dimensions)
((eql (first symbolic) :rotate)
(let ((dimensions (case (second symbolic)
((:right :left) (list (first dimensions)(third dimensions)(second dimensions)))
((:rear :front) (list (third dimensions)(second dimensions)(first dimensions)))
((:top :bottom) (list (second dimensions)(first dimensions)(third dimensions)))
(otherwise dimensions))))
(swap-dimensions dimensions (rest (rest symbolic)))))
(t (swap-dimensions dimensions (rest (rest symbolic))))))
(defun flatten-lines (lines)
(let (result)
(dolist (line lines (nreverse result))
(push (first line) result)
(push (second line) result))))
(defun flatten-curves (curves)
(let (result)
(dolist (curve curves (nreverse result))
(push (first curve) result)
(push (second curve) result)
(push (third curve) result)
(push (fourth curve) result))))
| 34,888 | Common Lisp | .lisp | 627 | 40.291866 | 154 | 0.554922 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | b96e4b09a578c91b42a260a062b6b25cd4f1859682f801e53543abdf44726c38 | 35,762 | [
-1
] |
35,763 | circle.lisp | lisp-mirror_gendl/geom-base/wire/source/circle.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object circle (arc)
:documentation (:description "The set of points equidistant from a given point.
The distance from the center is called the radius, and the point is called
the center. The start point of the circle is at the 3 o'clock position, and positive
angles are measured anti-clockwise."
:examples "<pre>
(in-package :gdl-user)
(define-object circle-sample (circle)
:computed-slots
((radius 10)))
(generate-sample-drawing :objects (make-object 'circle-sample))
</pre>")
:computed-slots
((%renderer-info% (list :vrml? t :view-default :top))
("Number. The perimeter of the circle."
circumference (* 2pi (the radius)))
("Number. The area enclosed by the circle."
area (* pi (^2 (the radius))))
(start-angle 0) (end-angle 2pi)))
;;
;; FLAG -- update for auto-scaling outside base-view
;;
;; FLAG -- remove this and handle in base-view output of generic
;; curves (if possible). Or, do only the fill part here.
;;
;;
;;(define-view (pdf circle)()
;; :output-functions
;; ((cad-output
;; ()
;; (let ((curves (the curves)))
;; (pdf:with-saved-state
;; (write-the line-thickness-setting)
;; (write-the rgb-stroke-setting)
;; (when (the fill-color-decimal) (apply #'pdf:set-rgb-fill (the fill-color-decimal)))
;; (let ((start (world-to-drawing (first (first curves)))))
;; (pdf:move-to (get-x start) (get-y start))
;; (mapc #'(lambda(curve)
;; (destructuring-bind (p1 p2 p3 p4) (world-to-drawing curve)
;; (declare (ignore p1))
;; (pdf:bezier-to (get-x p2) (get-y p2)
;; (get-x p3) (get-y p3)
;; (get-x p4) (get-y p4)))) curves))
;; (if (the fill-color-decimal) (pdf:fill-and-stroke) (pdf:stroke)))))))
| 2,888 | Common Lisp | .lisp | 65 | 39.738462 | 92 | 0.638298 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 8872ab5aff26f5dae85199d2af041b1290dd4c1d4f038527043eb0dc69c5cebf | 35,763 | [
-1
] |
35,764 | global-filleted-polyline.lisp | lisp-mirror_gendl/geom-base/wire/source/global-filleted-polyline.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object global-filleted-polyline-mixin (global-polyline-mixin)
:documentation (:description "Generates a polyline with the corners filleted according to default radius or the radius-list.")
:input-slots
(vertex-list
("Boolean. Controls whether the filleted-polyline should automatically be closed."
closed? (coincident-point? (first (the :vertex-list))
(lastcar (the :vertex-list))))
("List of Numbers. Specifies the radius for each vertex (``corner'') of the filleted-polyline."
radius-list nil)
("Number. Specifies a radius to use for all vertices. Radius-list will take precedence over this."
default-radius (lastcar (the :radius-list))))
:computed-slots
(("List of pairs of 3D points. Each pair represents the start and end of each straight segment of the
filleted-polyline."
straights (let ((count -1) (length (length (the :lines))))
(mapcar #'(lambda(line)
(incf count)
;;
;; FLAG -- does not handle straight section on closed polyline
;; from end to start
;;
(list (cond ((and (= count 0) (the :closed?))
(second (the :fillets :last :tangents)))
((= count 0) (first line))
((typep (the (:fillets (1- count))) 'null-part)
(first line))
(t (second (the (:fillets (1- count)) :tangents))))
(cond ((and (= count (1- length)) (the :closed?))
(first (the :fillets :last :tangents)))
((= count (1- length)) (second line))
((typep (the (fillets count)) 'null-part)
(second line))
(t (first (the (:fillets count) :tangents))))))
(the :lines))))
(%lines-to-draw% (the :straights))
(%%lines-to-draw%% (the :straights))
(%corners% nil)
;;
;; FLAG --replace with function call returning fillet-curves.
;;
(%curves-to-draw% (apply #'append (list-elements (the :fillets) (the-element :%curves-to-draw%))))
(%arcs% (list-elements (the fillets)))
(%renderer-info% (list :vrml? t :view-default :top))
(path-info (cond
((null (rest (the vertex-list)))
(error "Vertex-list must contain at least two points."))
((null (rest (rest (the vertex-list))))
(list :move (first (the vertex-list)) :line (second (the vertex-list))))
(t (append
(let ((first? t))
(mapcan
#'(lambda(straight curve-set)
(append (if first? (progn (setq first? nil)
(list :move (first straight)
:line (second straight)))
(list :line (second straight)))
(apply #'append
(mapcar #'(lambda(curve)
(cons :curve (rest (reverse curve))))
(reverse (the-object curve-set %curves-to-draw%))))))
(the straights) (list-elements (the fillets))))
(when (> (length (the straights)) (the fillets number-of-elements))
(list :line (second (lastcar (the straights)))))))))
(fillet-types (mapcar #'(lambda(test)
(if (the-object test valid?) 'fillet 'null-part))
(list-elements (the fillet-tests)))))
;;
;; FLAG --replace with function call returning fillet-curves.
;;
:hidden-objects
((fillet-tests :type 'fillet-tester
:sequence (:size (the fillets number-of-elements))
:direction-vectors (list (reverse-vector
(direction-vector (nth (the-child :index) (the :lines))))
(if (and (the-child :last?) (the :closed?))
(direction-vector (first (the :lines)))
(direction-vector (nth (1+ (the-child :index)) (the :lines)))))
:valid? (not (or (apply #'same-direction-vectors? (the-child direction-vectors))
(same-direction-vectors? (first (the-child direction-vectors))
(reverse-vector (second (the-child direction-vectors)))))))
)
:hidden-objects
(("Sequence of fillets. Each fillet is essentially an arc representing the curved elbow
of the filleted-polyline."
fillets :type (:sequence (the fillet-types))
:sequence (:size (if (the :closed?)
(1- (length (the :vertex-list)))
(- (length (the :vertex-list)) 2)))
:radius (or (nth (the-child :index)(the :radius-list))
(the :default-radius)
(error "You must specify a radius for global-filleted-polyline - root-path is ~s~%"
(the root-path)))
:local-vertex (nth (1+ (the-child :index)) (the :vertex-list))
:direction-vectors (the (fillet-tests (the-child index)) direction-vectors))
(lins :type 'line
:sequence (:size (length (the straights)))
:pass-down (orientation)
:start (first (nth (the-child index) (the straights)))
:end (second (nth (the-child index) (the straights))))
)
:functions
(
(interpolated-points
(&optional (curve-chords *curve-chords*))
(let (last-bezier-point)
(append
(mapcan #'(lambda(straight fillet)
(append (list (first straight))
(let ((beziers (chain-curves (list-elements (the-object fillet beziers)) (second straight))))
(mapcan #'(lambda(bezier)
(let ((points (the-object bezier (equi-spaced-points curve-chords))))
(setq last-bezier-point (lastcar points))
(butlast points))) beziers))))
(the straights) (list-elements (the fillets)))
(list last-bezier-point)
(if (the closed?)
(list (first (first (the straights))))
(list (lastcar (lastcar (the straights))))))))))
(define-object global-filleted-polyline (global-filleted-polyline-mixin)
:documentation (:description "A sequence of points connected by straight line segments, whose
corners are filleted according to specified radii. Please see global-filleted-polyline-mixin
for documentation on the messages."
:examples "<pre>
(in-package :gdl-user)
(define-object global-filleted-polyline-sample (global-filleted-polyline)
:computed-slots
((default-radius 5)
(vertex-list (list (make-point 0 0 0)
(make-point 10 10 0)
(make-point 30 10 0)
(make-point 40 0 0)
(make-point 30 -10 0)
(make-point 10 -10 0)
(make-point 0 0 0)))))
(generate-sample-drawing :objects (make-object 'global-filleted-polyline-sample))
</pre>"))
(define-object fillet-tester (base-object)
:input-slots (direction-vectors valid?))
;;
;;FLAG -- try to compute curves in pre-chained manner so this is not necessary...
;;
(defun chain-curves (curves start &key closed? (rank 3))
(when curves
(let* ((beziers? (typep (first curves) 'bezier-curve))
(first-getter (if beziers? #'(lambda(obj)(first (the-object obj control-points))) #'first))
(lastcar-getter (if beziers? #'(lambda(obj)(lastcar (the-object obj control-points))) #'lastcar))
(reverser (if beziers? #'(lambda(obj) (the-object obj reverse)) #'reverse)))
(let ((start-match (position start curves :test (lambda(p1 p2) (coincident-point? p1 p2 :rank rank)) :key first-getter))
(end-match (position start curves :test (lambda(p1 p2) (coincident-point? p1 p2 :rank rank)) :key lastcar-getter)))
(cond ((and (not closed?) start-match end-match)
(error "start matches both start and end of curve in chain-curves"))
((and (null start-match) (null end-match))
(error "curves did not chain in chain-curves"))
(start-match
(cons (nth start-match curves)
(chain-curves (append (subseq curves 0 start-match)
(subseq curves (1+ start-match)))
(funcall lastcar-getter (nth start-match curves)) :rank rank)))
(end-match (cons (funcall reverser (nth end-match curves))
(chain-curves (append (subseq curves 0 end-match)
(subseq curves (1+ end-match)))
(funcall first-getter (nth end-match curves)) :rank rank))))))))
| 10,151 | Common Lisp | .lisp | 183 | 40.885246 | 128 | 0.5578 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 4f3a521ec75711fd1b73d65e684b2f4a90820bd6f48ba9e5e3d342bb53d75690 | 35,764 | [
-1
] |
35,765 | spherical-cap.lisp | lisp-mirror_gendl/geom-base/wire/source/spherical-cap.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object spherical-cap (ifs-output-mixin arcoid-mixin base-object)
:documentation (:description "The region of a sphere which lies above (or below) a given plane. Although this
could be created with a partial sphere using the sphere primitive, the spherical cap allows for more convenient
construction and positioning since the actual center of the spherical cap is the center of its reference box."
:examples "<pre>
(in-package :gdl-user)
(define-object spherical-cap-sample (spherical-cap)
:computed-slots
((base-radius 150)
(cap-thickness 7)
(axis-length (* (the base-radius) +phi+))
(number-of-vertical-sections 10)
(number-of-horizontal-sections 10)
(display-controls (list :color :orchid-medium :transparency 0.5))))
(generate-sample-drawing :objects (make-object 'spherical-cap-sample)
:projection-direction :trimetric)
</pre>")
:input-slots ("Number. The distance from the center of the base to the center of the dome."
axis-length
"Number. Radius of the base."
base-radius
("Number. Thickness of the shell for a hollow spherical-cap. Specify this
or inner-base-radius, not both."
cap-thickness nil)
("Number. Radius of base of inner for a hollow spherical-cap. Specify this
or cap-thickness, not both."
inner-base-radius nil)
("Integer. How many lines of latitude to show on the spherical-cap in some renderings. Default value is 2."
number-of-horizontal-sections 4)
("Integer. How many lines of longitude to show on the spherical-cap in some renderings. Default value is 2."
number-of-vertical-sections 4)
(inner? nil)
(closed? t))
:computed-slots
((%renderer-info% (list :vrml? t :view-default :trimetric))
(length (twice (the sphere-radius)))
(width (the length))
(height (the axis-length))
("Number. Radius of the sphere containing the spherical-cap."
sphere-radius (+ (/ (^2 (the :base-radius)) (twice (the :axis-length)))
(half (the :axis-length))))
("3D Point. Center of the sphere containing the spherical-cap."
sphere-center (translate (the (:face-center :top)) :down (the sphere-radius)))
(base-center (translate (the center) :down (half (the axis-length))))
(cap-thickness-c (or (the :cap-thickness)
(when (the :inner-base-radius)
(- (the :sphere-radius)
(sqrt (+ (^2 (the :inner-base-radius))
(^2 (- (the :sphere-radius) (the :axis-length)))))))))
(inner-base-radius-c (or (the :inner-base-radius)
(when (the :cap-thickness)
(sqrt (- (^2 (- (the :sphere-radius) (the :cap-thickness)))
(^2 (- (the :sphere-radius) (the :axis-length))))))))
(%lines-to-draw% (the :radials))
(%curves-to-draw% (append
(when (or (the :cap-thickness) (the :inner-base-radius))
(the :inner-cap :%curves-to-draw%))
(apply #'append (list-elements (the :meridians) (the-element :curves)))
(apply #'append (list-elements (the :parallels) (the-element :curves)))))
(start-angle (angle-between-vectors (subtract-vectors (translate (the :base-center) :right
(the :base-radius))
(the :sphere-center))
(subtract-vectors (translate (the :sphere-center) :right
(the :sphere-radius))
(the :sphere-center))
(the (:face-normal-vector :rear)) :-ve t))
(parallel-angle (/ (- (the :end-angle-normalized) (the :start-angle-normalized))
(the :number-of-vertical-sections)))
(end-angle pi/2)
(meridian-angle (/ (twice pi) (the :number-of-horizontal-sections)))
(radials (let (result)
(dotimes (count (the :meridians :number-of-elements) (nreverse result))
(push (list (if (typep (the :inner-cap) 'spherical-cap)
(the :inner-cap (:meridians count) :start)
(the :base-center))
(the (:meridians count) :start)) result))))
(polygon-points (mapcar #'(lambda(parallel)
(the-object parallel (equi-spaced-points (max (the number-of-vertical-sections) 12))))
(list-elements (the parallels))))
(polygons-for-ifs (let ((thickness? (and (not (the inner?)) (typep (the inner-cap) 'spherical-cap))))
(append (apply #'append
(mapcar #'(lambda(list1 list2)
(mapcar #'(lambda(p1 p2 p3 p4)
(list p1 p2 p4 p3))
list1 (rest list1) list2 (rest list2)))
(the polygon-points) (rest (the polygon-points))))
(when (and (not thickness?) (the closed?))
(list (first (the polygon-points))))
(when thickness? (the inner-cap polygons-for-ifs))
(when thickness?
(mapcar #'(lambda(p1 p2 p3 p4)
(list p1 p2 p4 p3))
(first (the polygon-points))
(rest (first (the polygon-points)))
(first (the inner-cap polygon-points))
(rest (first (the inner-cap polygon-points)))))))))
:hidden-objects
((inner-cap :type (if (and (the :inner-base-radius-c)
(the :cap-thickness-c)) 'spherical-cap 'null-part)
:base-radius (the :inner-base-radius-c)
:inner? t
:center (translate (the center) :down (half (the cap-thickness-c)))
:pass-down (:number-of-horizontal-sections :number-of-vertical-sections)
:axis-length (- (the :axis-length) (the :cap-thickness-c)))
(meridians :type 'arc
:sequence (:size (the :number-of-horizontal-sections))
:pass-down (:start-angle :end-angle)
:center (the :sphere-center)
:radius (the :sphere-radius)
:orientation (alignment :top (rotate-vector (the (:face-normal-vector :rear))
(* (the :meridian-angle)
(the-child :index))
(the (:face-normal-vector :top)))
:rear (the (:face-normal-vector :top))
))
(parallels :type 'arc
:sequence (:size (1+ (the :number-of-vertical-sections)))
:center (let* ((ray (rotate-vector (the (:face-normal-vector :right))
(+ (the :start-angle-normalized)
(* (the :parallel-angle) (the-child :index)))
(the (:face-normal-vector :front))))
(sphere-point (inter-line-sphere (the :sphere-center) ray
(the :sphere-center)
(the :sphere-radius) ray)))
(inter-line-plane (the :sphere-center) (the (:face-normal-vector :top))
sphere-point (the (:face-normal-vector :top))))
:radius (let ((center (the-child center))
(point (inter-line-sphere (the-child :center)
(the (:face-normal-vector :right))
(the :sphere-center)
(the :sphere-radius)
(the (:face-normal-vector :right)))))
(if (and center point)
(3d-distance center point)
0)))))
| 9,661 | Common Lisp | .lisp | 156 | 41.807692 | 125 | 0.523055 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | f9d76513bf2da462c5278c0ef737bfff14fe3f50a24da08a37dc33c36eac0123 | 35,765 | [
-1
] |
35,766 | global-filleted-polygon-projection.lisp | lisp-mirror_gendl/geom-base/wire/source/global-filleted-polygon-projection.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object global-filleted-polygon-projection (global-polygon-projection)
:documentation (:description "Similar to a global-polygon-projection, but the polygon is filleted
as with global-filleted-polygon."
:examples "<pre>
(in-package :gdl-user)
(define-object global-filleted-polygon-projection-sample
(global-filleted-polygon-projection)
:computed-slots
((display-controls (list :color :blue-steel
:transparency 0.3
:shininess 0.7
:spectral-color :white))
(default-radius 5)
(projection-depth 5)
(vertex-list (list (make-point 0 0 0)
(make-point 10 10 0)
(make-point 30 10 0)
(make-point 40 0 0)
(make-point 30 -10 0)
(make-point 10 -10 0)
(make-point 0 0 0)))))
(generate-sample-drawing :objects
(make-object 'global-filleted-polygon-projection-sample)
:projection-direction :trimetric)
</pre>")
:input-slots
(("List of Numbers. Specifies the radius for each vertex (``corner'') of the filleted-polyline."
radius-list nil)
("Number. Specifies a radius to use for all vertices. Radius-list will take precedence over this."
default-radius nil))
:computed-slots
((polygon-type 'global-filleted-polyline)
(crease-angle (half pi))
(%curves-to-draw% (append (the :polygon-original :%curves-to-draw%)
(the :polygon-1 :%curves-to-draw%)
(when (typep (the :polygon-2) (the :polygon-type))
(the :polygon-2 :%curves-to-draw%))))
(%arcs% (append (the :polygon-original :%arcs%)
(the :polygon-1 :%arcs%)
(when (typep (the :polygon-2) (the :polygon-type))
(the :polygon-2 :%arcs%))))
(projection-lines (mapcar #'(lambda(line)
(list (the-object line :start)
(the-object line :end))) (list-elements (the :projection-line-objects)))))
:hidden-objects
(;; FLAG -- get rid of this quantified set.
;;
(projection-line-objects
:type 'line
:sequence (:size (twice (length (the :polygon-original :straights))))
:start (let ((straight (nth (floor (half (the-child :index)))
(the (evaluate (if (typep (the :polygon-2)
(the :polygon-type))
:polygon-2 :polygon-original)) :straights))))
(funcall (if (oddp (the-child :index)) #'first #'second) straight))
:end (let ((straight (nth (floor (half (the-child :index))) (the :polygon-1 :straights))))
(funcall (if (oddp (the-child :index)) #'first #'second) straight)))))
| 3,986 | Common Lisp | .lisp | 78 | 38.192308 | 114 | 0.575616 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | c4a238a99346e36c54e10661a9149b9dfcdcd2031653c0d2d3a4282c32fc350c | 35,766 | [
-1
] |
35,767 | ellipse.lisp | lisp-mirror_gendl/geom-base/wire/source/ellipse.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object ellipse (arcoid-mixin base-object)
:documentation (:description "A curve which is the locus of all points in the plane
the sum of whose distances from two fixed points (the foci) is a given positive constant.
This is a simplified 3D ellipse which will snap to the nearest quarter if you make it a
partial ellipse. For a full ellipse, do not specify start-angle or end-angle."
:examples "<pre>
(in-package :gdl-user)
(define-object ellipse-sample (ellipse)
:computed-slots
((minor-axis-length 10)
(major-axis-length (* (the minor-axis-length) +phi+))
(start-angle 0)
(end-angle pi)))
(generate-sample-drawing :objects (make-object 'ellipse-sample))
</pre>")
:input-slots
("Number. Length of (generally) the longer ellipse axis"
major-axis-length
"Number. Length of (generally) the shorter ellipse axis"
minor-axis-length
("Angle in Radians. Start angle of the ellipse. Defaults to 0 for full ellipse."
start-angle 0)
("Angle in Radians. End angle of the ellipse. Defaults to 2pi for full ellipse."
end-angle 2pi))
:computed-slots
(
(%renderer-info% (list :vrml? t :view-default :top))
(%curves-to-draw% (the :control-point-lists))
(curves (the :control-point-lists))
(control-point-lists (if (and (null (the start-angle))
(null (the end-angle)))
(the :control-point-lists-all)
(remove nil
(list (when (and (< (the start-angle-normalized) pi/2)
(>= (the end-angle-normalized) pi/2))
(the (:control-point-list :rear :right)))
(when (and (<= (the start-angle-normalized) pi/2)
(>= (the end-angle-normalized) pi))
(the (:control-point-list :left :rear)))
(when (and (<= (the start-angle-normalized) pi)
(>= (the end-angle-normalized) (/ (* pi 3) 2)))
(the (:control-point-list :front :left)))
(when (and (<= (the start-angle-normalized) (/ (* pi 3) 2))
(>= (the end-angle-normalized) 2pi))
(the (:control-point-list :right :front)))))))
(control-point-lists-all (list (the (:control-point-list :rear :right))
(the (:control-point-list :left :rear))
(the (:control-point-list :front :left))
(the (:control-point-list :right :front))))
(length (the minor-axis-length))
(width (the major-axis-length))
(height 0)
)
:functions
((control-point-list
(face-1 face-2)
(let ((minor-axis-length (the :minor-axis-length))
(major-axis-length (the :major-axis-length)))
(let ((face-1-radial-length (half (ecase face-1 ((:rear :front) minor-axis-length)
((:right :left) major-axis-length))))
(face-2-radial-length (half (ecase face-2 ((:rear :front) minor-axis-length)
((:right :left) major-axis-length)))))
(let ((face-1-kappa-factor (* face-1-radial-length +kappa+))
(face-2-kappa-factor (* face-2-radial-length +kappa+)))
(let ((center (the :center)))
(list (translate center face-1 face-1-radial-length)
(translate center face-1 face-1-radial-length face-2 face-2-kappa-factor)
(translate center face-2 face-2-radial-length face-1 face-1-kappa-factor)
(translate center face-2 face-2-radial-length)))))))))
(defun sub-arc (radius start-angle end-angle true-center
right-vector rear-vector front-vector top-vector)
(declare (optimize (speed 3) (safety 1) (debug 0)))
(let* ((center +nominal-origin+)
(start-to-end-angle (- end-angle start-angle))
(theta-1 (half start-to-end-angle))
(cos-theta-1 (cos theta-1))
(x-1 (* (/ (- 4 cos-theta-1) 3) radius))
(y-1 (* (/ (* (- 1 cos-theta-1) (- cos-theta-1 3)) (* 3 (sin theta-1))) radius))
(mid-point (translate-along-vector center right-vector x-1))
(construction-p-1 (translate-along-vector mid-point rear-vector y-1))
(construction-p-2 (translate-along-vector mid-point front-vector y-1))
(start (translate-along-vector center (rotate-vector right-vector start-angle top-vector) radius))
(end (translate-along-vector center (rotate-vector right-vector end-angle top-vector) radius))
(new-angle (+ start-angle theta-1))
(p-1 (rotate-point construction-p-1 center top-vector :angle new-angle))
(p-2 (rotate-point construction-p-2 center top-vector :angle new-angle)))
(list (add-vectors start true-center)
(add-vectors p-1 true-center)
(add-vectors p-2 true-center)
(add-vectors end true-center))))
;; FLAG -- remove this and handle in base-view output of generic
;; curves (if possible). Or, do only the fill part here.
;;
;;(define-view (pdf ellipse)()
;; :output-functions
;; ((cad-output
;; ()
;; ;;
;; ;; FLAG -- computed curves in a pre-chained manner to avoid having to chain them.
;; ;;
;; (if (and (null (the start-angle))
;; (null (the end-angle)))
;; (let ((curves (chain-curves (the curves) (first (first (the curves))) :closed? t)))
;; (pdf:with-saved-state
;; (write-the line-thickness-setting)
;; (write-the rgb-stroke-setting)
;; (when (the fill-color-decimal) (apply #'pdf:set-rgb-fill (the fill-color-decimal)))
;; (let ((start (world-to-drawing (first (first curves)))))
;; (pdf:move-to (get-x start) (get-y start))
;; (mapc #'(lambda(curve)
;; (destructuring-bind (p1 p2 p3 p4) (world-to-drawing curve)
;; (declare (ignore p1))
;; (pdf:bezier-to (get-x p2) (get-y p2)
;; (get-x p3) (get-y p3)
;; (get-x p4) (get-y p4)))) curves))
;; (if (the fill-color-decimal) (pdf:fill-and-stroke) (pdf:stroke))))
;; (call-next-method)))))
;;
| 7,696 | Common Lisp | .lisp | 139 | 43.697842 | 108 | 0.561778 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 20bbc4f2fbb7ad5a1aa81429ab58722ac2e1b8526d061b2ba0461df02b65f262 | 35,767 | [
-1
] |
35,768 | l-line.lisp | lisp-mirror_gendl/geom-base/wire/source/l-line.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object line (base-object)
:documentation (:description "Provides a simple way to create a line,
by specifying a start point and an end point."
:examples "<pre>
(in-package :gdl-user)
(define-object line-sample (line)
:computed-slots
((start (make-point -10 -10 0))
(end (make-point 10 10 0))))
(generate-sample-drawing :objects (make-object 'line-sample))
</pre>")
:input-slots
("3D Point. The start point of the line, in global coordinates."
start
"3D Point. The end point of the line, in global coordinates."
end)
:computed-slots
(
(%renderer-info% (list :vrml? t :view-default :top))
(%lines-to-draw% (list (list (the :start) (the :end))))
("3D Point. The center of the line."
center (if (coincident-point? (the start) (the end))
(the start)
(translate-along-vector (the :start) (the :direction-vector)
(half (the :length)))))
("Number. The distance from start to end of the line."
length (3d-distance (the :start) (the :end)))
(total-length (the length))
("3D Vector. Points from start to end of the line."
direction-vector (subtract-vectors (the :end) (the :start)))
(bounding-box (bounding-box-from-points (list (the start) (the end))))))
| 2,326 | Common Lisp | .lisp | 52 | 37.711538 | 76 | 0.669273 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 9e949a4661341cbcdb3246910b8fe9f26da998a9c0009483a6a295b071485346 | 35,768 | [
-1
] |
35,769 | cone.lisp | lisp-mirror_gendl/geom-base/wire/source/cone.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object cone ( cylinder)
:documentation (:description "A pyramid with a circular cross section, with its vertex above
the center of its base. Partial cones and hollow cones are supported."
:examples "<pre>
(in-package :gdl-user)
(define-object cone-sample (cone)
:computed-slots
((display-controls (list :color :blue-neon
:transparency 0.5
:shininess 0.8
:specular-color :white))
(length 10) (radius-1 2)(inner-radius-1 1)
(radius-2 5) (number-of-sections 5)
(inner-radius-2 3)))
(generate-sample-drawing :objects (make-object 'cone-sample)
:projection-direction :trimetric)
</pre>")
:input-slots
(
("Number. The radius of the top end of the cone."
radius-1 (the :radius))
("Number. The radius of the bottom end of the cone."
radius-2 0)
("Number. The radius of the inner hollow part at the top end for a hollow cone."
inner-radius-1 (the :inner-radius))
("Number. The radius of the inner hollow part at the bottom end for a hollow cone."
inner-radius-2 (the :inner-radius)))
:computed-slots
((width (twice (max (the radius-1) (the radius-2))))
(height (the width))
(simple? (and (not (the inner-radius))
(zerop (the radius-2))
(near-to? (the arc) 2pi)))
))
| 2,375 | Common Lisp | .lisp | 55 | 35.818182 | 96 | 0.656333 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | b5cce020a89a8b7038f1a751a730cbf87b3492403b357979858af19e5f47b2ac | 35,769 | [
-1
] |
35,770 | bounding-box.lisp | lisp-mirror_gendl/geom-base/wire/source/bounding-box.lisp | ;;
;; Copyright 2002-2011 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
(in-package :geom-base)
(define-object bbox (base-object) :input-slots (xmin ymin zmin xmax ymax zmax))
| 969 | Common Lisp | .lisp | 22 | 41.727273 | 80 | 0.744433 | lisp-mirror/gendl | 0 | 0 | 0 | AGPL-3.0 | 9/19/2024, 11:44:17 AM (Europe/Amsterdam) | 7cdda92ec5b1e9117ae3d5c083836b8260efd7d4148fc5857d312059ca3b370e | 35,770 | [
-1
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.