Download presentation
Presentation is loading. Please wait.
Published byArabella Hodge Modified over 9 years ago
1
CADjs Primitives and Booleans
2
3D Solids There are 6 primitives that CADjs supports That is all you will need to create complex shapes.
3
Variables a=2+1; g1=cube(a) g1.display(); Looks the same as cube(1), but is bigger
4
Cube Create a cuboid of dimensions 10 x 5 x 1 g=cube(10,5,1); g.display(); Press F5 to run
5
Cylinder radius = 1.0; height = 2.0; g = cylinder(radius,height); g.display(); Increase smoothness and Press F5
6
Sphere g=sphere(1); g.display(); Can increase quality for smoothness
7
Cone g=cone(2,1,3); g.display();
8
Torus g=torus(2,1); g.display();
9
Display Color g = cube(1); g.display('blue'); Others: Red, green, yellow Magenta, teal, chocolate, …
10
Display Transparent g = cube(1); g.displayTransparent();
11
Program for your name Enter: g = textGeom("CADjs"); g.display();
12
Question
13
Booleans There are 3 Booleans that CADjs supports That is all you will need.
14
Subtraction g1=cube(1);Parent Material g2=sphere(.6);Subtracting Material g3=g1.difference(g2);Command g1-g2 g3.display();Display
15
Addition g1=cube(1);Parent Material g2=sphere(.6);Adding Material g3=g1.union(g2);Command g1+g2 g3.display();Display
16
Intersection g1=cube(1);Parent Material g2=sphere(.6);Intersecting Material g3=g1.intersection(g2);Command g1 interest g2 g3.display();Display
17
Question 3 Primitives? Boolean operations?
18
Hint g1 = cube(1); g2 = sphere(0.6); g3 = cylinder(0.4,2); g1.display(); g2.display(); g3.display(); Goal
19
Solution g1 = cube(1); g2 = sphere(0.6); g3 = cylinder(0.4,2); g4 = g1.union(g2).difference(g3); g4.display();
20
Order of Boolean Operation Matters g1 = cube(1); g2 = sphere(0.6); g3 = cylinder(0.4,2); g4 = g1. difference(g3).union(g2); g4.display(); Order of Boolean Operations matters! g1 = cube(1); g2 = sphere(0.6); g3 = cylinder(0.4,2); g4 = g1.union(g2).difference(g3); g4.display();
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.