CADjs Complex Geometry More Triangles Slower CAD Tip 1 Start with Coarse Model 5 seconds 20 seconds Tip 2 Choose primitives carefully Cube 12 triangles Cylinder Sphere Tip 3 Merge versus Union ID: 759561
Download Presentation The PPT/PDF document "CADjs Tips for Accelerating" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
CADjsTips for Accelerating CADjs
Slide2Complex Geometry
More Triangles
Slower CAD
Slide3Tip 1: Start with Coarse Model
5 seconds
20 seconds
Slide4Tip 2: Choose primitives carefully
Cube: 12 triangles
Cylinder
Sphere
Slide5Tip 3: Merge versus Union
R = 1.0;
H = 0.25;
r = 0.1;
h =
0.55;
s = 0.8
;
pin
= cylinder(
r,h
).
translateY
(H/2+h/2).
translateX
(s);
N = 8; // number of pins
pins =
pin.clone
();
for (
i
= 0;
i
< N;
i
++) {
pin
=
pin.rotateY
(360/N);
pins
=
pins.union
(pin
);
}
base = cylinder(R,H);
base =
base.union
(pins);
base.display
();
Slide6Exercise
N = 6 pins
N = 8 pins
Modify your code to handle N pins
N = 3 pins
Slide7Exercise
R
= 1.0;
H = 0.25
;
A = cylinder(R,H);
r = 0.1;
h = 0.5;
s = 0.8;
pin = cylinder(
r,h
).
translateY
(H/2+h/2).
translateX
(s);
N = 8; // number of pins
for (
i
= 0;
i
< N;
i
++) {
A
=
A.union
(pin);
pin
=
pin.rotateY
(360/N);
}
A.display
();