@@ -32,7 +32,7 @@ def slice_file(f=None, resolution=0.1):
32
32
print ("Status: Loading File." )
33
33
34
34
stlobj = STLModel (f )
35
- scale = 10
35
+ scale = 100
36
36
stats = stlobj .stats ()
37
37
38
38
sub_vertex = Vector3 (stats ['extents' ]['x' ]['lower' ], stats ['extents' ]['y' ]['lower' ], stats ['extents' ]['z' ]['lower' ])
@@ -55,18 +55,13 @@ def slice_file(f=None, resolution=0.1):
55
55
facet .vertices [1 ] = (facet .vertices [1 ] * scale ) + add_vertex
56
56
facet .vertices [2 ] = (facet .vertices [2 ] * scale ) + add_vertex
57
57
58
- facet .vertices [0 ].integerise ()
59
- facet .vertices [1 ].integerise ()
60
- facet .vertices [2 ].integerise ()
61
-
62
58
# Recalculate the facet normal
63
59
64
60
u = stlobj .triangles [0 ].vertices [1 ] - stlobj .triangles [0 ].vertices [0 ]
65
61
v = stlobj .triangles [0 ].vertices [2 ] - stlobj .triangles [0 ].vertices [0 ]
66
62
67
63
facet .n = Normal ((u .y * v .z )- (u .z * v .y ), (u .z * v .x )- (u .x * v .z ), (u .x * v .y )- (u .y * v .x ))
68
64
stlobj .update_extents (facet )
69
- # So now, we have all of the points as integers...
70
65
71
66
print ("Status: Calculating Slices" )
72
67
@@ -134,7 +129,7 @@ def findInterpolatedPoint(A, B):
134
129
pair .append ((int (facet .vertices [2 ].x ), int (facet .vertices [2 ].y )))
135
130
136
131
if len (pair ) == 2 :
137
- dwg .add (dwg .line (pair [0 ], pair [1 ], stroke = rgb (50 , 50 , 50 , '%' )))
132
+ dwg .add (dwg .line (pair [0 ], pair [1 ], stroke = rgb (0 , 0 , 0 , '%' )))
138
133
139
134
dwg .save ()
140
135
0 commit comments