Skip to content

Commit

Permalink
Increase slope of feet
Browse files Browse the repository at this point in the history
  • Loading branch information
rchristie committed Oct 27, 2024
1 parent 9ad9121 commit 6d42792
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
9 changes: 5 additions & 4 deletions src/scaffoldmaker/meshtypes/meshtype_3d_wholebody2.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def getDefaultOptions(cls, parameterSetName="Default"):
options["Leg length"] = 10.0
options["Leg top diameter"] = 2.0
options["Leg bottom diameter"] = 0.7
options["Foot height"] = 1.0
options["Foot height"] = 1.25
options["Foot length"] = 2.5
options["Foot thickness"] = 0.3
options["Foot width"] = 1.0
Expand Down Expand Up @@ -537,16 +537,17 @@ def generateBaseMesh(cls, region, options):
nodeIdentifier += 1
# foot
fx = [x,
add(add(legStart, mult(legDirn, legLength - halfFootThickness)),
[0.0, 0.0, 0.25 * footLength + legBottomRadius]),
add(add(legStart, mult(legDirn, legLength - 1.5 * halfFootThickness)),
[0.0, 0.0, legBottomRadius]),
add(add(legStart, mult(legDirn, legLength - halfFootThickness)),
[0.0, 0.0, footLength - legBottomRadius])]
fd1 = smoothCubicHermiteDerivativesLine(
fx, [d1, [0.0, 0.0, 0.5 * footLength], [0.0, 0.0, 0.5 * footLength]],
fixAllDirections=True, fixStartDerivative=True)
fd2 = [d2, mult(legSide, halfFootWidth), mult(legSide, halfFootWidth)]
fd3 = [d3,
set_magnitude(sub(legFront, legDirn), legBottomRadius),
set_magnitude(sub(legFront, legDirn),
math.sqrt(2.0 * halfFootThickness * halfFootThickness) + legBottomRadius),
set_magnitude(cross(fd1[2], fd2[2]), halfFootThickness)]
fd12 = sub(fd2[2], fd2[1])
fd13 = sub(fd3[2], fd3[1])
Expand Down
34 changes: 17 additions & 17 deletions tests/test_wholebody2.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_wholebody2_core(self):
minimums, maximums = evaluateFieldNodesetRange(coordinates, nodes)
tol = 1.0E-4
assertAlmostEqualList(self, minimums, [0.0, -3.7000751482231564, -1.25], tol)
assertAlmostEqualList(self, maximums, [20.437483381451223, 3.7000751482231564, 2.15], tol)
assertAlmostEqualList(self, maximums, [20.48332368641937, 3.7000751482231564, 2.15], tol)

with ChangeManager(fieldmodule):
one = fieldmodule.createFieldConstant(1.0)
Expand All @@ -88,17 +88,17 @@ def test_wholebody2_core(self):
result, surfaceArea = surfaceAreaField.evaluateReal(fieldcache, 1)
self.assertEqual(result, RESULT_OK)

self.assertAlmostEqual(volume, 98.99087587225652, delta=tol)
self.assertAlmostEqual(surfaceArea, 229.8973868830034, delta=tol)
self.assertAlmostEqual(volume, 98.86108394657288, delta=tol)
self.assertAlmostEqual(surfaceArea, 229.91482811362502, delta=tol)

# check some annotation groups:

expectedSizes3d = {
"abdominal cavity": (40, 10.081327011840981),
"core": (428, 45.78886468970665),
"abdominal cavity": (40, 10.074522362520469),
"core": (428, 45.718809433770865),
"head": (64, 6.909618374858558),
"thoracic cavity": (40, 7.135491643165788),
"shell": (276, 53.20466827197639)
"shell": (276, 53.14474281170343)
}
for name in expectedSizes3d:
term = get_body_term(name)
Expand All @@ -114,13 +114,13 @@ def test_wholebody2_core(self):
self.assertAlmostEqual(volume, expectedSizes3d[name][1], delta=tol)

expectedSizes2d = {
"abdominal cavity boundary": (64, 27.46017763836879),
"abdominal cavity boundary": (64, 27.428203203724674),
"diaphragm": (20, 3.0778936559347208),
"left arm skin epidermis": (68, 22.627795339108015),
"left leg skin epidermis": (68, 55.21582811667045),
"left leg skin epidermis": (68, 55.24949927903832),
"right arm skin epidermis": (68, 22.62779533911023),
"right leg skin epidermis": (68, 55.21582811667045),
"skin epidermis": (388, 229.8973868830034),
"right leg skin epidermis": (68, 55.24949927903832),
"skin epidermis": (388, 229.91482811362502),
"thoracic cavity boundary": (64, 20.606925296069125)
}
for name in expectedSizes2d:
Expand All @@ -137,7 +137,7 @@ def test_wholebody2_core(self):
self.assertAlmostEqual(surfaceArea, expectedSizes2d[name][1], delta=tol)

expectedSizes1d = {
"spinal cord": (8, 10.856804626156244)
"spinal cord": (8, 10.854535713176467)
}
for name in expectedSizes1d:
term = get_body_term(name)
Expand Down Expand Up @@ -183,9 +183,9 @@ def test_wholebody2_tube(self):
coordinates = fieldmodule.findFieldByName("coordinates").castFiniteElement()
self.assertTrue(coordinates.isValid())
minimums, maximums = evaluateFieldNodesetRange(coordinates, nodes)
tol = 1.0E-6
tol = 1.0E-4
assertAlmostEqualList(self, minimums, [0.0, -3.7000751482231564, -1.25], tol)
assertAlmostEqualList(self, maximums, [20.437483381451223, 3.7000751482231564, 2.15], tol)
assertAlmostEqualList(self, maximums, [20.48332368641937, 3.7000751482231564, 2.15], tol)

with ChangeManager(fieldmodule):
one = fieldmodule.createFieldConstant(1.0)
Expand All @@ -212,13 +212,13 @@ def test_wholebody2_tube(self):
result, innerSurfaceArea = innerSurfaceAreaField.evaluateReal(fieldcache, 1)
self.assertEqual(result, RESULT_OK)

self.assertAlmostEqual(volume, 53.20377108353156, delta=tol)
self.assertAlmostEqual(outerSurfaceArea, 225.79241553960935, delta=tol)
self.assertAlmostEqual(innerSurfaceArea, 155.88335089354402, delta=tol)
self.assertAlmostEqual(volume, 53.1439368556073, delta=tol)
self.assertAlmostEqual(outerSurfaceArea, 225.80985677023105, delta=tol)
self.assertAlmostEqual(innerSurfaceArea, 155.85891324174113, delta=tol)

# check some annotationGroups:
expectedSizes2d = {
"skin epidermis": (320, 229.04017126690428)
"skin epidermis": (320, 229.05761249752587)
}
for name in expectedSizes2d:
term = get_body_term(name)
Expand Down

0 comments on commit 6d42792

Please sign in to comment.