compas-dev / compas

Core packages of the COMPAS framework.
https://compas.dev/compas/
MIT License
305 stars 104 forks source link

`Brep.from_boolean_*` methods incorrectly decorated as classmethod? #1371

Open gonzalocasas opened 2 weeks ago

gonzalocasas commented 2 weeks ago

The brep boolean operations are marked and documented as classmethods, but they don't work as such.

The following code should work according to the documentation:

from compas.geometry import Brep

brep_c2 = Brep.from_cylinder(cc2)
brep_c3 = Brep.from_cylinder(cc3)
result = Brep.from_boolean_intersection(brep_c2, brep_c3)

however, this results in a PluginNotInstalledError exception.

For this to work, one needs to use the instance:

from compas.geometry import Brep

brep_c2 = Brep.from_cylinder(cc2)
brep_c3 = Brep.from_cylinder(cc3)
result = brep_c2.from_boolean_intersection(brep_c2, brep_c3)

But that doesn't make much sense. If the plugin system cannot correctly detect this, maybe we should just make them not class methods?

chenkasirer commented 2 weeks ago

Thanks @gonzalocasas! this should indeed work as a classmethod and does work as expected with the OCC backend. I was able to reproduce this in Rhino though, will have a look at what's causing it.