gumyr / build123d

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

Offset should not require a minimum of 2 edges #139

Closed jdegenstein closed 1 year ago

jdegenstein commented 1 year ago

https://github.com/gumyr/build123d/blob/7eb673a0fe10fbcebfc739708a7604fcc17b5a6b/src/build123d/build_generic.py#L419-L420

Offset raises a ValueError("At least two edges are required") when one edge is passed in. I see no reason for this limitation. I tested without it and it worked fine on a single edge.

Offset of a single straight edge results in a rectangle with rounded ends, which is desirable because it is similar to the concept of "stroke path" in Inkscape.

gumyr commented 1 year ago

This was an OCCT bug - that sounds like it's been fixed - thankfully.

gumyr commented 1 year ago

The fundamental OCCT issue is still there - a single linear Edge does not work. However, the single edge can be broken in two and combined in a Wire and it works. ¯\_(ツ)_/¯

Fixed with latest commit.