<- previous    index    next ->

Lecture 3c, many shapes

Some applications use fracture to produce shapes.
Sample code for dealing with triangles follow:

The three Python program sequence to develop triangle shape:

shape_tritri.py3 source code
shape_tritri_py3.out output
shape_tritri_py3.dat  2D



dat_2d_3d.java source code
dat_2d_3d_java.out output
shape_tritri.stl  stl



shape_tritri2.py3 source code
shape_tritri2_py3.out output
shape_tritri2_py3.dat  2D



shape_tritri3.py3 source code
shape_tritri3_py3.out output
shape_tritri3_py3.dat  2D




shape35.py3 source code
shape35_py3.out output




now 3D version

shape35_3d.py3 source code shape35_3d_py3.out output shape35_3d_py3.dat 2D

more 3D shapes just z=0 and z=5 using tri4 shape48.py3 source code shape48_py3.dat 2D shape48a.py3 source code shape48a_py3.dat 2D shape49.py3 source code shape49_py3.dat 2D shape50.py3 source code shape50_py3.dat 2D

cone development

cone_3d.py3 source code cone_3d_py3.out output cone_3d_py3.dat 3D cone_3d_py3.stl 3D Initial development, just outside Then add inside final .stl ready for 3D printing More shapes for 3D printing (.stl files) shape67.py3 source code shape67.dat shape67.stl 3D printing shape69.py3 source code shape69_py3.dat 3D shape69.stl 3D printing

rotating the 3D object in a .dat file

dat_rotate.py3 source code cube2.dat data command python3 dat_rotate.py3 cube2.dat cube2_rot.dat 45.0 45.0 45.0 > dat_rotate_py3.out dat_rotate_py3.out output cube2_rot.dat output Simple shape, 2D fan blade shape_38.py3 source code shape_38_py3.out shape_38_py3.dat Simulating a binary clock (they can be bought) binary_clock.py3 source code binary_clock_py3.out clock running First clock view: binary_clock.py3 running 0 0 0 add 8 if 1 0 0 0 0 0 add 4 if 1 0 0 0 0 0 0 add 2 if 1 0 0 0 0 0 0 add 1 if 1 hr min sec hr : min : sec binary 0 0 0 0 0 0 0 0 1 1 binary 0 0 0 0 1 1 1 1 0 0 binary 0 0 1 1 0 0 1 1 0 0 binary 0 1 0 1 0 1 0 1 0 1 decimal 0 1 2 3 4 5 6 7 8 9 starting at 12 midnight, a new day then going to 12 noon, and on sec 0 12 : 0 : 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 12 : 0 : 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
    <- previous    index    next ->

Other links

Many web sites on Java GUI, AWT, Swing, etc.
Many web sites on Python wx, tk, qt, etc.

Go to top