Skip to content

Commit

Permalink
plugIn bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophSchranz committed Dec 8, 2016
1 parent 7c8561c commit a13291a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions AutoRotate PlugIn/Cura15_04/printableObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,14 @@ def resetRotation(self):
self.processMatrix()


# Replaced to Auto Rotate Object
# Replaced with Auto Rotate Object
def layFlat(self):
st = time.time()
# st=time.time()

mesh = list(map(lambda v: [v[0], v[1], v[2]], self._meshList[0].vertexes))
TweakedObject = MeshTweaker.Tweak(self._meshList[0].vertexes)

TweakedObject = MeshTweaker.Tweak(mesh)

self.applyMatrix(numpy.matrix(TweakedObject.Matrix, numpy.float64))

# with open("C:\\Users\\Chris\\Desktop\\log.txt", "w") as f:
# f.write(str(self._originFilename)+ "\ntime needed: " + str(time.time()-st))

Expand Down
7 changes: 3 additions & 4 deletions MeshTweaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ class Tweak:
And the relative unprintability of the tweaked object. If this value is
greater than 10, a support structure is suggested.
"""
def __init__(self, content, extended_mode=False, verbose=True,
def_z=[0,0,1]):
def __init__(self, content, extended_mode=False, verbose=True):

self.extended_mode = extended_mode
n = -np.array(def_z, dtype=np.float64)
n = -np.array([0,0,1], dtype=np.float64)
orientations = [[list(n), 0.0]]

## Preprocess the input mesh format.
Expand Down Expand Up @@ -290,7 +289,7 @@ def lithograph(self, mesh, orientation):
else: plafond = 0
if len(overhangs) > 0:
overhang = np.sum(overhangs[:,5,0] * 2
*(np.amax((np.full(len(overhangs),0.5),
*(np.amax((np.zeros(len(overhangs))+0.5,
-np.inner(overhangs[:,0,:], orientation))
,axis=0) -0.5 )**2)
overhang = overhang - PLAFOND_ADV * plafond
Expand Down
Binary file modified __pycache__/MeshTweaker.cpython-34.pyc
Binary file not shown.
Binary file modified __pycache__/MeshTweaker.cpython-35.pyc
Binary file not shown.

0 comments on commit a13291a

Please sign in to comment.