Skip to content
Snippets Groups Projects
Commit c13b8be2 authored by mehtank's avatar mehtank
Browse files

Default units in m instead of mm

parent cf473039
No related merge requests found
...@@ -35,6 +35,7 @@ function init() { ...@@ -35,6 +35,7 @@ function init() {
var mesh = new THREE.Mesh( geometry, material ); var mesh = new THREE.Mesh( geometry, material );
mesh.castShadow = true; mesh.castShadow = true;
mesh.receiveShadow = true; mesh.receiveShadow = true;
mesh.scale.set( 1000,1000,1000);
geometry.computeFaceNormals(); geometry.computeFaceNormals();
geometry.computeVertexNormals(); geometry.computeVertexNormals();
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
Material: Material:
<select name="$thickness"> <select name="$thickness">
<option value="0">Paper</option> <option value="0">Paper</option>
<option value="3">3mm plywood</option> <option value=".003">3mm plywood</option>
<option value="5">5mm plywood</option> <option value=".005">5mm plywood</option>
</select> <br><br> </select> <br><br>
<button type=submit>Make!</button> <button type=submit>Make!</button>
......
...@@ -8,7 +8,7 @@ c.addSubcomponent("legr","VLeg", inherit=True, prefix=None) ...@@ -8,7 +8,7 @@ c.addSubcomponent("legr","VLeg", inherit=True, prefix=None)
c.addSubcomponent("legt","VLeg", inherit=True, prefix=None) c.addSubcomponent("legt","VLeg", inherit=True, prefix=None)
c.addSubcomponent("legb","VLeg", inherit=True, prefix=None) c.addSubcomponent("legb","VLeg", inherit=True, prefix=None)
c.addParameter("length", 70) c.addParameter("length", 70e-3)
c.addConstraint(("top","l"), "length") c.addConstraint(("top","l"), "length")
c.addConstraint(("top","w"), "width") c.addConstraint(("top","w"), "width")
......
...@@ -32,7 +32,7 @@ connections: ...@@ -32,7 +32,7 @@ connections:
- [legl, leftedge] - [legl, leftedge]
- {angle: 90} - {angle: 90}
interfaces: {} interfaces: {}
parameters: {height: 40, length: 70, taper: 0.5, thickness: 10, width: 50} parameters: {height: 0.04, length: 0.07, taper: 0.5, thickness: 0.01, width: 0.05}
subcomponents: subcomponents:
legb: legb:
classname: VLeg classname: VLeg
......
...@@ -8,16 +8,16 @@ from svggen.utils.mymath import sin, deg2rad ...@@ -8,16 +8,16 @@ from svggen.utils.mymath import sin, deg2rad
class Stool(Component): class Stool(Component):
_test_params = { _test_params = {
'height': 60, 'height': 60e-3,
'legs': 3, 'legs': 3,
'radius': 20, 'radius': 20e-3,
'angle': 80, 'angle': 80,
} }
def define(self): def define(self):
self.addParameter("height", 60) self.addParameter("height", 60e-3)
self.addParameter("legs", 3) self.addParameter("legs", 3)
self.addParameter("radius", 20) self.addParameter("radius", 20e-3)
self.addParameter("angle", 80) self.addParameter("angle", 80)
def assemble(self): def assemble(self):
...@@ -27,9 +27,9 @@ class Stool(Component): ...@@ -27,9 +27,9 @@ class Stool(Component):
ap = self.getParameter("angle") ap = self.getParameter("angle")
# XXX TODO: add min and max values to Parameter objects # XXX TODO: add min and max values to Parameter objects
h = max(hp, 10) h = max(hp, 10e-3)
n = max(lp, 2) * 2 n = max(lp, 2) * 2
e = max(2*rp*sin(deg2rad(180./n)), 10) e = max(2*rp*sin(deg2rad(180./n)), 10e-3)
graph = Graph() graph = Graph()
graph.addFace(Shape("", n, e), "seat") graph.addFace(Shape("", n, e), "seat")
......
...@@ -7,16 +7,16 @@ from svggen.api.ports.EdgePort import EdgePort ...@@ -7,16 +7,16 @@ from svggen.api.ports.EdgePort import EdgePort
class VLeg(Component): class VLeg(Component):
_test_params = { _test_params = {
'height': 40, 'height': 40e-3,
'width': 50, 'width': 50e-3,
'thickness': 10, 'thickness': 10e-3,
'taper': 0.5, 'taper': 0.5,
} }
def define(self): def define(self):
self.addParameter("height", 40) self.addParameter("height", 40e-3)
self.addParameter("width", 50) self.addParameter("width", 50e-3)
self.addParameter("thickness", 10) self.addParameter("thickness", 10e-3)
self.addParameter("taper", 0.5) self.addParameter("taper", 0.5)
self.addInterface("leftedge", EdgePort(self, None)) self.addInterface("leftedge", EdgePort(self, None))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment