gumyr / build123d

A python CAD programming library
Apache License 2.0
402 stars 75 forks source link

Strange behavior of CenterArc with offset #214

Closed OvisMaximus closed 1 year ago

OvisMaximus commented 1 year ago

Given the following code

from build123d import *

ring_diameter = 110

with BuildPart(Plane.XZ) as part_builder:
    with BuildLine(Plane.XY) as sweep_path:
        a_clamp_width = 12
        CenterArc((-ring_diameter/2, 0), ring_diameter / 2, -a_clamp_width / 2, a_clamp_width)

    with BuildSketch(Plane.XZ) as sketch_builder:
        Rectangle(4.0, 8.0, align=(Align.CENTER,Align.MIN))

    sweep()
    #extrude(amount=5, both=True)

show_object(part_builder.part.wrapped, name="part")
show_object(sweep_path.line.wrapped, name="sweep_path")
show_object(sketch_builder.sketch.wrapped, name="sketch")

The sweep-path is a circle segment on the XY plane crossing the (0, 0, 0) coordinate. This is what we got rendered: image

when we move the CenterArc to (0,0) in its initializer, we will get: image the latter meets my expectation, the first doesnt.

gumyr commented 1 year ago

There indeed was a bug which has been fixed - thanks for reporting it. The path is now: image