Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
elias-soltani committed Sep 24, 2020
1 parent e92a372 commit 1943644
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/scaffoldmaker/meshtypes/meshtype_1d_path1.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ def generateBaseMesh(cls, region, options):

@classmethod
def smoothPath(cls, region, options, mode : DerivativeScalingMode):
x, d1 = extractPathParametersFromRegion(region, [Node.VALUE_LABEL_VALUE, Node.VALUE_LABEL_D_DS1])[0:2]
x, d1 = extractPathParametersFromRegion(region, [Node.VALUE_LABEL_VALUE, Node.VALUE_LABEL_D_DS1])
d1 = smoothCubicHermiteDerivativesLine(x, d1, magnitudeScalingMode=mode)
setPathParameters(region, [ Node.VALUE_LABEL_VALUE, Node.VALUE_LABEL_D_DS1 ], [ x, d1 ])

@classmethod
def makeD2Normal(cls, region, options):
if not options['D2 derivatives']:
return
d1, d2 = extractPathParametersFromRegion(region, [Node.VALUE_LABEL_D_DS1, Node.VALUE_LABEL_D_DS2])[0:2]
d1, d2 = extractPathParametersFromRegion(region, [Node.VALUE_LABEL_D_DS1, Node.VALUE_LABEL_D_DS2])
for c in range(len(d1)):
td2 = vector.vectorRejection(d2[c], d1[c])
d2[c] = vector.setMagnitude(td2, vector.magnitude(d2[c]))
Expand All @@ -152,12 +152,12 @@ def makeD3Normal(cls, region, options):
return
if options['D2 derivatives']:
d1, d2, d3 = extractPathParametersFromRegion(region, [Node.VALUE_LABEL_D_DS1, Node.VALUE_LABEL_D_DS2,
Node.VALUE_LABEL_D_DS3])[0:3]
Node.VALUE_LABEL_D_DS3])
for c in range(len(d1)):
d3[c] = vector.setMagnitude(vector.crossproduct3(d1[c], d2[c]), vector.magnitude(d3[c]))
setPathParameters(region, [Node.VALUE_LABEL_D_DS3], [d3])
else:
d1, d3 = extractPathParametersFromRegion(region, [Node.VALUE_LABEL_D_DS1, Node.VALUE_LABEL_D_DS3])[0:2]
d1, d3 = extractPathParametersFromRegion(region, [Node.VALUE_LABEL_D_DS1, Node.VALUE_LABEL_D_DS3])
for c in range(len(d1)):
td3 = vector.vectorRejection(d3[c], d1[c])
d3[c] = vector.setMagnitude(td3, vector.magnitude(d3[c]))
Expand Down

0 comments on commit 1943644

Please sign in to comment.