Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gendl
gendl
Commits
b3f1bada
Commit
b3f1bada
authored
Feb 16, 2012
by
Dave Cooper
Browse files
added x3d support for spherical-cap
parent
5b06e69a
Changes
4
Hide whitespace changes
Inline
Side-by-side
demos/wire-world/source/assembly.lisp
View file @
b3f1bada
...
...
@@ -15,7 +15,7 @@
:display-controls
(
list
:color
:brown
)
:radius
3
:inner-radius
2.5
:end-horizontal-arc
pi
;;
:end-horizontal-arc pi
:start-vertical-arc
0
:end-vertical-arc
(
/
pi
4
)
:center
(
translate
(
the
center
)
:left
10
:rear
10
:up
(
the-child
radius
)))
...
...
@@ -46,6 +46,15 @@
;;:arc pi
)
(
reactor
:type
'spherical-cap
:display-controls
(
list
:color
:purple
)
:base-radius
3
:axis-length
2
:center
(
translate
(
the
center
)
:up
(
half
(
the-child
height
))
:left
17
:front
5
))
(
silo
:type
'silo
:radius
1
...
...
@@ -66,6 +75,7 @@
((
roof
:type
'sphere
:display-controls
(
list
:color
:orange
)
:center
(
translate
(
the
center
)
:rear
(
half
(
the
length
)))
:end-horizontal-arc
pi
:pass-down
(
radius
)
)
...
...
gdl/geom-base/wire/source/arc.lisp
View file @
b3f1bada
...
...
@@ -135,7 +135,9 @@ the start and end point of the arc.
:arguments (angle \"Number in Radians\")"
point-on-arc
(
angle
)
(
rotate-point
(
the
start
)
(
the
center
)
(
the
(
face-normal-vector
:top
))
:angle
angle
))))
(
if
(
the
start
)
(
rotate-point
(
the
start
)
(
the
center
)
(
the
(
face-normal-vector
:top
))
:angle
angle
)
(
the
center
)))))
...
...
gdl/geom-base/wire/source/spherical-cap.lisp
View file @
b3f1bada
...
...
@@ -21,7 +21,7 @@
(
in-package
:geom-base
)
(
define-object
spherical-cap
(
arcoid-mixin
base-object
)
(
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
...
...
@@ -67,7 +67,10 @@ construction and positioning since the actual center of the spherical cap is the
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
))
number-of-vertical-sections
4
)
(
inner?
nil
)
(
closed?
t
))
:computed-slots
...
...
@@ -125,12 +128,41 @@ construction and positioning since the actual center of the spherical cap is the
(
push
(
list
(
if
(
typep
(
the
:inner-cap
)
'spherical-cap
)
(
the
:inner-cap
(
:meridians
count
)
:start
)
(
the
:base-center
))
(
the
(
:meridians
count
)
:start
))
result
)))))
(
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
)))
...
...
surf/lenses/source/x3d.lisp
View file @
b3f1bada
...
...
@@ -456,7 +456,7 @@
(
cl-who:with-html-output
(
*stream*
nil
:indent
t
)
(
:Shape
(
:Appearance
(
write-the
material-properties
))
((
:IndexedFaceSet
:solid
"
false
"
((
:IndexedFaceSet
:solid
"
FALSE
"
:creaseAngle
"1.571"
:coordIndex
(
format
nil
"~{~{~a~^ ~}~^ -1 ~}"
(
the
ifs-indices
)))
((
:Coordinate
:point
(
format
nil
"~{~{~a~^ ~}~^ ~}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment