-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMaxReadME.txt~
62 lines (36 loc) · 3.12 KB
/
MaxReadME.txt~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Simple User Input Sculpture Generation
Software Design Spring 2016 Final Project: Generating 3D objects based on simple user input and exporting them as an STL file that can be 3D printed, rendered, or otherwise fabricated
Authors: Coleman Ellis, Claire Kincaid, Maximillian Schommer
Getting Started
As of yet, our program requires the following packages to run correctly:
SolidPython
OpenCV
Numpy
Pickle
Scikit Image
Mayavi
numpy-stl
noise
We also recommend downloading and installing OpenSCAD, so you can easily compile an STL using the code we currently have in place.
To install, just download the git repository and use the files locally (or add them to the folder where Python can access them). We're not at a point where we can provide an installer yet.
Usage
Geometry.py
Using the Geometry program, you can define shapes, transformations to apply to those shapes over time, and then output those shapes to an OpenSCAD file to render them as an STL (OpenSCAD is fairly slow, a more efficient solution is pending).
There are currently three ways to define a polygon: the Polygon, n-Sided-Polygon, and Square classes (with more to come). The easiest to use is a Square, so let's use that as an example. To define a Square, use the following code:
sqr = Square() #Generates a 2x2 square centered on the origin
A square by itself isn't super interesting, so let's add a rotation:
rot = Rotation(360,(0,0)) #Represents a rotation of 360 degrees about the origin
Now to apply the rotation to the square, we add them both to an Animation:
anim = Animation(sqr,[rot]) #If we had more transformations to apply, they'd also go in the list
Then just export the animation:
anim.render_shapes() #Exports to test.scad by default
You should now have an OpenSCAD file showing a square rotating 360 degrees as it moves upwards! From here you can play with adding different shapes (either regular polygons using n_Sided_Polygon, or Polygons defined using lists of points), and different transformations (rotations of different degrees or about different points, as well as dilations). You can make some really interesting sculptures with just a few shapes and a few transformations.
Just a warning though, OpenSCAD takes about 1~2 minutes per shape to render as an STL.
sculpture_gen.py
Using the sculpture_gen program, you can create solids by mathmatically defining them. Begin the progam by running it in the terminal. Answer y/n to the prompts if not otherwise specified. If you choose to mathmatically define objects, then choose the menu item and enter functions and then boolean operations to perform on the functions. A rendering will appear after a boolean operation is completed. Right now, there is no way to view the items you are combining, which will be fixed.
For the function blobby extrude, you choose an image to inspire the program. The image will then be processed and a random sculpture will be created from that image.
Currently, the i menu option is not functional, but will be soon. An improved user interface will also be availible in the next update.
ctrl+C will exit the program.
The GUI
License
How do we want to do this?