Message 1 of 4
Bug Report: negative offset to Sketch.offset sometimes results in incorrect results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Depending on the exact geometry, if you try to pass a negative offset to Sketch.offset, sometimes the resulting offset curve will be offset by a slightly less amount than requested.
As you can see, the offset constraint is correctly shown as 1.00, but the actual distance is .894
Code:
def run(_):
app = adsk.core.Application.get()
design = adsk.fusion.Design.cast(app.activeProduct)
root = design.rootComponent
occurrence = root.occurrences.addNewComponent(adsk.core.Matrix3D.create())
sketch = occurrence.component.sketches.add(root.xYConstructionPlane)
sketch_line = sketch.sketchCurves.sketchLines.addByTwoPoints(
adsk.core.Point3D.create(0, 0, 0),
adsk.core.Point3D.create(0, .25, 0))
sketch_lines = adsk.core.ObjectCollection.create()
sketch_lines.add(sketch_line)
sketch.offset(
sketch_lines,
sketch.modelToSketchSpace(adsk.core.Point3D.create(.5, .5, 0)),
-.1)
In the meantime, a workaround is to always use a positive offset, and use a different reference point depending on which way you want to offset.
One workaround is to uuse a different reference point,