Open Windfisch opened 8 months ago
There isn't a lot of type checking on the inputs of the build123d API which can lead to these types of problems. However, catching these problems early can generate meaningful error messages which would help usability.
Hi,
the
project
function silently generates an unusableCompound
when trying toproject(some_solid)
.. When calling.faces()
,.edges()
or.vertices()
on that Compound (or trying toshow()
it), an exception is raised.That
project
does not work on a Solid is not the issue and is expected according to the documentation, which states: _"Parameters: objects (Union[Edge, Face, Wire, VectorLike, Vertex] or Iterable of) – objects or points to project"_However, the behavior of the function should be more clear. I would expect a clear message like
ValueError("project does not accept solids, try your_solid.faces()")
, but not a broken object.Steps to reproduce
Expected behaviour
The
foo = project(...)
line should throw aValueError
with a helpful error messageor: The
foo = project(some_solid)
call should behave the same asfoo = project(some_solid.faces())
.Actual behavior
The
foo.vertices()
call raises the following exception: