Yes and No, it depends, on whta you are trying to do.jonasb wrote: ↑Sat Jan 15, 2022 1:53 pm Such a hypothetical "Thickness2D" could be similar to Part Offset2D, but producing not only one offset, but two: one on each side of the referenced lines.
Usually using offset you are otaining different shapes as offset tend to make things using some math behind that make
This code:
Code: Select all
def wire_shape():
pol_r = (
(000.0, 00.0, 0.0),
(135.0, 00.0, 0.0),
(135.0, 48.4, 0.0),
(131.0, 54.3, 0.0),
(105.1, 56.6, 0.0),
(070.0, 58.5, 0.0),
(053.3, 59.4, 0.0),
(025.8, 82.0, 0.0),
(002.8, 82.0, 0.0),
(000.0, 67.2, 0.0),
(000.0, 00.0, 0.0)
)
rim_profile = Part.makePolygon(pol_r)
# Part.show(rim_profile, "rim_profile")
return rim_profile
obj = wire_shape()
Part.show(obj, "original_wire")
o_off = 1.5
obj1 = obj.makeOffset2D(o_off * -1)
Part.show(obj1, "neg_off_wire")
obj2 = obj.makeOffset2D(o_off)
Using GUI Offset2D could use a different strategy to offset corners, when I've used it on my "original_wire" polygon, using mode=Pipe, join=Tangent.
I obtain:
At least in FreeCAD 0.20, Libs: 0.20R26720 (Git).
What is correct, for me GUI way is more correct, but makeOffset2D method is more coherent from what I was used in other CAD/CAM as on a corner the "correct" constant distance is a radius, like when cutting with a cnc.
This pose a question? How to achieve this behaviour with Scripting?
Sorry for some OT parts.
Regards
Carlo D.