Open jdegenstein opened 1 year ago
This problem is related to the sketch being created off of Plane.XY
. With the following change (and removal of the final fillet):
# vtxs = s.sketch.vertices().sort_by(Axis.X)[-3]
vtxs = s.sketch_local.vertices().sort_by(Axis.X)[-3]
one gets:
In the original version, the vertex being selected is part of the relocated/global version of the sketch, not the one on Plane.XY
/local that is actively being created. By changing the vertex selector to work on s.sketch_local
the vertex is being selected on the actual sketch under construction and it works as expected. (Note is the screen shot the vertex to the right of the objects - this is the selected vertex on Plane.XY
.)
So how can this be addressed? The fillet
operation could (should?) be enhanced to check to see if the Vertex
/Edge
is actually part of the Shape
being worked on. If not, as in this case, a ValueErrror
should be generated. If the fillet
operation is in the scope of BuildSketch
, the error handling could even to see if the vertex is in one of the global sketches and not the local sketch and give a precise error message saying the user must select from sketch_local
.
Any other ideas of how to address this?
I do think better error handling is in order here to help new users.
In hindsight, I believe the "correct" approach is to use e.g. vtxs = s.vertices().sort_by(Axis.X)[-3]
instead of vtxs = s.sketch.vertices().sort_by(Axis.X)[-3]
. Example 16 in the intro docs uses the former approach. This is what I have done in the past, although I am not sure if there are any other benefits to using sketch_local
.
This seems to occur more frequently on inside corners in my experience. I receive no warnings or error messages and the script runs "fine". Here is some code to reproduce the screenshot: