CADjs Cloning and for loops. wheel, hub and spoke assembly g1 = cube(5); g2=cylinder(1,20); g3=cylinder(1,20); g4=cylinder(20,2); g5=cylinder(10,2); g2.rotateX(90);

Slides:



Advertisements
Similar presentations
Surface Area of a cylinder Objective: Be able to calculate the surface area of a cylinder.
Advertisements

Surface Area of Prisms and Cylinders 10-4 Holt Geometry.
Surface Area of a Cylinder By Bill Rawlins Geometry.
Volume.
Surface Area of Cylinders
12 – 3 Cylinders and Cones.
Unit 2: Engineering Design Process
Volume and surface area of solids
Characteristics of 3-D Shapes
 Algebra 1 Remediation September 3 Start on page 208 of practice packet.
Volumes Lesson
No Warm-Ups This Week We will have a test Monday over formulas and area.
Equations of Circles 10.6 California State Standards 17: Prove theorems using coordinate geometry.
3-D Modeling Concepts V part 2.
9-2C Volume of Cylinders and Cones What is the difference in volume between cylinders and cones with the same area bases and same height? How do you find.
Quiz-Warm Up! Remember 5 minutes only!
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Chapter 6 Geometry.
Release Items End–of–Instruction ACE Geometry.
Foundations of Technology Calculating Area and Volume
Warm Up Find the perimeter and area of each polygon.
Volume of Prisms and Cylinders
Perimeter, Area, Surface Area, and Volume Examples
Rectangular Prisms and Cylinders
VOLUME Volume is a measure of the space within a solid figure, like ball, a cube, cylinder or pyramid. Its units are at all times cubic. The formula of.
Geometry Honors Section 7.1 Surface Area and Volume of Boxes.
Volume of Pyramids & Cones How would the volume of a cylinder and cone with the same height and radius be similar? Different? How about a prism and pyramid.
Cornell Notes Today Volume
Volume of Cylinders, Cones, and Spheres. Warm Up: Find the area of: A circle with a radius of 3cm. A rectangle with side lengths of 4ft and 7ft. A square.
1 The width, height, and length of a box or rectangular prism can be different. If all three are the same, then the box is a cube. Rectangular Prism The.
Volume of prisms and cylinders
Find the volume of this cylinder 4 cm 3 cm Find the VOLUME of this prism 6 m 10 m.
Volume of Rectangular Prisms and Cylinders. Question 1 What is volume? * the number of cubic units needed to fill the space inside a figure.
Grade 8 math chart TCU Is Going To The Rose Bowl!!!!!!!!!!!!!!!!!!!!
Perimeter, Area, and Volume Geometry and andMeasurement.
2012 IDEA ASSEMBLY “HINT” PACK. ARM: draw in 2D Copy / paste this view into Inventor.
Unit 6 3D Modeling Concepts
CHAPTER 8 Geometry Slide 2Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc. 8.1Basic Geometric Figures 8.2Perimeter 8.3Area 8.4Circles 8.5Volume.
Shape, Space and Measure 2 CyberDesign.co.uk 2005 Volume of a cuboid Volume is the amount of space inside 3-D shapes A cube of 1 cm edge has a volume of.
Sullivan Algebra and Trigonometry: Section R.3 Geometry Review Objectives of this Section Use the Pythagorean Theorem and Its Converse Know Geometry Formulas.
College Algebra Section R.3 Geometry Review Objectives of this Section Use the Pythagorean Theorem and Its Converse Know Geometry Formulas.
From CADjs to 3-D Printing. Area & Volume g = cube(1); g.display(); Area? Volume? g = cube(1); g.display(); g.info();
Holt Geometry 10-6 Volume of Prisms and Cylinders Warm Up Find the area of each figure. Round to the nearest tenth. 1. an equilateral triangle with edge.
CADjs Primitives and Booleans. 3D Solids There are 6 primitives that CADjs supports That is all you will need to create complex shapes.
The Circle. Examples (1) – (5) Determine the center and radius of the circle having the given equation. Identify four points of the circle.
THIS IS With Host... Your AreaVolumeRectanglesCirclesPrisms Cylinders.
CHAPTER 12 AREAS AND VOLUMES OF SOLIDS 12-3 CYLINDERS AND CONES.
CADjs Polygons and Polyarcs
CADjs Warnings, Errors, Comments and Variable Naming.
Geometry Section 10.5 Segments of Chords. In this section, we will be finding the lengths of segments formed when chords intersect.
Geometry Overview. Angles AngleSizeExample Right90˚ Straight180˚ Acute90˚
Surface Area If you remove the surface from a three-dimensional figure and lay it out flat, the pattern you make is called a net. Nets allow you to see.
Equation of a Circle. Equation Where the center of the circle is (h, k) and r is the radius.
Notes Over 3.4Volume The volume of a box is the number of cubic units it can hold. Rectangular box: Cube: Sphere:
Surface Area of a Cylinder Geometry. Overview Find the area of a circle Find the circumference of a circle Find the area of rectangle Find the surface.
Geometry 12.3 Part 1 Cylinders. Right Cylinders Oblique Cylinders.
Section 12-3 Cylinders. cylinder It is like a prism except that its bases are circles instead of polygons. Bases.
Jeopardy Terminology Quiz Geometry All points on a circle are the same distance from this point. (100)
The total area of a cube is 54 square units. Find the length of an edge Find the volume Edge = 3 units V = 27 cubed units.
12.7 Similar. Today we will… Return to the idea Of similar objects.
Surface area of a cylinder Imagine a cylinder opened out Rectangle Circle.
CADjs Tips for Accelerating CADjs
Honors Geometry Solids Project
CADjs Functions.
CADjs Transformations
Volume.
Volume of Pyramids and Cones
EVERYTHING YOU NEED TO KNOW TO GET A GRADE C
12.4 Volume of Prisms and Cylinders
12.4 Volume of Prisms and Cylinders
Area Surface Area Volume
Presentation transcript:

CADjs Cloning and for loops

wheel, hub and spoke assembly g1 = cube(5); g2=cylinder(1,20); g3=cylinder(1,20); g4=cylinder(20,2); g5=cylinder(10,2); g2.rotateX(90); g3.rotateZ(90); g=g4.difference(g5); g=g.union(g1); g=g.union(g2); g=g.union(g3); g.display();

Question

Idea of Cloning g1 = cylinder(0.5,0.5); g1.display(); Want to create another similar cylinders, but translated g1 = cylinder(0.5,0.5); g1.display(); g2 = g1;//make a copy? g2.translate(1);//translate g2 g2 = g1; … does not make copy g2 is exactly the same as g1 Translating g2 will also translate g1 g1 = cylinder(0.5,0.5); g1.display(); g2 = g1.clone();//makes a true copy g2.translate(1);// translate g2, but not g1 g2.display();

Idea of Copies g1 = cylinder(0.5,0.5); g1.display(); g2 = g1.clone();//makes a true copy g2.translate(1);// translate g2, but not g1 g2.display(); g3 = g1.clone();// g3.translate(2); g3.display(); … can continue, but better to use for loops!

for loops

for (i = 0;i < 5;i = i+1) { } ‘for’ loop Start at i = 0 Stop when i = 5 Increase i by 1 every loop How many times is the loop executed? i =0 i = 1 i = 2 i = 3 i = 4 (stop)

‘for’ loop with Beeper resetBeeper(); for (i = 0; i < 5; i= i+1){ beep(); } resetBeeper(); for (i = 0; i < 5; i++){ beep(); } Increase i by 1 every loop

‘for’ loop with Beeper resetBeeper(); for (i = 0; i <= 10; i= i+2){ beep(); } How many beeps? resetBeeper(); for (i = -5; i <2; i= i+1){ beep(); } How many beeps?

‘for’ loop with textGeom for (i = 0; i < 5; i++){ textGeom(i).translateX(i).display(); } for (i = -2; i <= 2; i = i+2){ textGeom(i).translateX(i).display(); }

‘for’ loop with textGeom for (i = 0; i < 5; i++){ textGeom(i).translateX(i).display(); } for (i = 0; i < 5; i++){ textGeom(2*i).translateX(i).display(); } for (i = 0; i < 5; i++){ textGeom(2*i).translateX(2*i).display(); }

For loop with geometry Use one cylinder and copy/move g = cylinder(.5,.5); for (i = 0;i < 5;i = i+1) { g1 = g.clone(); g1.translateX(i).display(); } Union with a base

For loop with geometry Union with a base base = cube(5,0.2,1).translateX(2.); g = cylinder(.5,.5); for (i = 0;i < 5;i = i+1) { g1 = g.clone(); base = base.union(g1.translateX(i)); } base.display();

Union ‘for’ loop g = cube(.5,.5); g1 = g.clone(); for (i = 0;i < 36;i++) { g1.rotateZ(10); g = g.union(g1); } g.display();

Union ‘for’ loop & difference g = cube(.5,.5); g1 = g.clone(); g2=cylinder(1,.45).rotateX(90); for (i = 0;i < 36;i++) { g1.rotateZ(10); g = g.union(g1); } g=g2.difference(g) g.display();

Lego model

Lego model: Step 1 g = cylinder(.5,.5); g1 = g.clone(); for (i = 0;i < 3;i++) { g1.translate(2,0,0); g = g.union(g1); } g.display();

Lego model: Step 2 g = cylinder(.5,.5); g1 = g.clone(); for (i = 0;i < 3;i++) { g1.translate(2,0,0); g = g.union(g1); } g3=g.clone().translate(0,0,2); g=g.union(g3); g.display();

Lego model: Step 3 g = cylinder(.5,.5); g1 = g.clone(); base=cube(8,3,4).translate(3,-1.75,1); for (i = 0;i < 3;i++) { g1.translate(2,0,0); g = g.union(g1); } g3=g.clone().translate(0,0,2); g=g.union(g3); g=g.union(base); g.display();

Lego model: Step 4 g = cylinder(.5,.5); g1 = g.clone(); base=cube(8,3,4).translate(3,-1.75,1); g4=cube(7,4,3).translate(3,-2.5,1); base=base.difference(g4); for (i = 0;i < 3;i++) { g1.translate(2,0,0); g = g.union(g1); } g3=g.clone().translate(0,0,2); g=g.union(g3); g=g.union(base); g.display();

Exercise (Ladder) 1.5 length, 0.1 width and height Length = 10, width = 0.25 (2 pieces, 1.25 apart)

Exercise (Ladder)

Exercise Radius = 1.0, height = 0.25 Radius = 0.1, height = 0.5 (centers on a circle of radius 0.8) 8 pins

Exercise N = 6 pins N = 8 pins Modify your code to handle N pins N = 3 pins

Exercise setDefaultSegments(24); 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();