Skip to content

Commit a1085ef

Browse files
committed
feat: minor change to account for zero height cut at the top of the lip, related to #77
1 parent a7808de commit a1085ef

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

lib/gridfinityUtils/binBodyLipGenerator.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ def createGridfinityBinBodyLip(
5454
lipBodyExtrude.endFaces.item(0),
5555
adsk.core.ValueInput.createByReal(0)
5656
)
57-
lipCutoutConstructionPlane = targetComponent.constructionPlanes.add(lipCutoutPlaneInput)
58-
lipCutoutConstructionPlane.name = "lip cutout construction plane"
5957

6058
if input.hasLipNotches:
6159
lipCutoutInput = BaseGeneratorInput()
@@ -112,24 +110,27 @@ def createGridfinityBinBodyLip(
112110
lipCutout.name = "lip cutout"
113111
lipCutoutBodies.append(lipCutout)
114112

115-
topChamferSketch: adsk.fusion.Sketch = targetComponent.sketches.add(lipCutoutConstructionPlane)
116-
topChamferSketch.name = "Lip top chamfer"
117-
sketchUtils.createRectangle(
118-
actualLipBodyWidth,
119-
actualLipBodyLength,
120-
topChamferSketch.modelToSketchSpace(adsk.core.Point3D.create(0, 0, topChamferSketch.origin.z)),
121-
topChamferSketch,
122-
)
123-
topChamferNegativeVolume = extrudeUtils.simpleDistanceExtrude(
124-
topChamferSketch.profiles.item(0),
125-
adsk.fusion.FeatureOperations.NewBodyFeatureOperation,
126-
const.BIN_LIP_TOP_RECESS_HEIGHT,
127-
adsk.fusion.ExtentDirections.NegativeExtentDirection,
128-
[],
129-
targetComponent,
130-
)
131-
topChamferNegativeVolume.name = "Lip top chamfer cut"
132-
bodiesToSubtract.append(topChamferNegativeVolume.bodies.item(0))
113+
if const.BIN_LIP_TOP_RECESS_HEIGHT > const.DEFAULT_FILTER_TOLERANCE:
114+
lipCutoutConstructionPlane = targetComponent.constructionPlanes.add(lipCutoutPlaneInput)
115+
lipCutoutConstructionPlane.name = "top lip edge plane"
116+
topChamferSketch: adsk.fusion.Sketch = targetComponent.sketches.add(lipCutoutConstructionPlane)
117+
topChamferSketch.name = "Lip top chamfer"
118+
sketchUtils.createRectangle(
119+
actualLipBodyWidth,
120+
actualLipBodyLength,
121+
topChamferSketch.modelToSketchSpace(adsk.core.Point3D.create(0, 0, topChamferSketch.origin.z)),
122+
topChamferSketch,
123+
)
124+
topChamferNegativeVolume = extrudeUtils.simpleDistanceExtrude(
125+
topChamferSketch.profiles.item(0),
126+
adsk.fusion.FeatureOperations.NewBodyFeatureOperation,
127+
const.BIN_LIP_TOP_RECESS_HEIGHT,
128+
adsk.fusion.ExtentDirections.NegativeExtentDirection,
129+
[],
130+
targetComponent,
131+
)
132+
topChamferNegativeVolume.name = "Lip top chamfer cut"
133+
bodiesToSubtract.append(topChamferNegativeVolume.bodies.item(0))
133134
bodiesToSubtract = bodiesToSubtract + lipCutoutBodies
134135

135136
combineUtils.cutBody(

0 commit comments

Comments
 (0)