compas icon indicating copy to clipboard operation
compas copied to clipboard

compas predicate support for compas geometry

Open tkmmark opened this issue 4 years ago • 2 comments

It would be great if the various compas.geometry methods (e.g. predicates, distance, etc) that take geometric information as arguments (e.g point, circles etc) can fully support the use of compas geometry as inputs.

For instance, in 'is_point_in_circle_xy', consider adopting 359-360 (or something more pythonic and elegant), so that the method can take both compas.geometry.Circle as inputs or a (point, radius) tuple. At present, the use of compas.geometry.Circle will throw an error as circle[0] as it refers to the plane of the circle, and not its centre, which would be circle[0][0].

image

tkmmark avatar Oct 10 '20 13:10 tkmmark

i think this is only the case for circles. afaik, all other objects can be indexed correctly. so perhaps we should just update the definition of a circle, because in many cases it is unnecessarily verbose...

tomvanmele avatar Oct 11 '20 07:10 tomvanmele

Will not disagree with simplifying the circle too, or at least simplifying the constructor so that one can instantiate with a point, and a radius (assumes xy plane by default). This is something I already do in my extended Circle class. As for updating the definition, I always thought the plane was included because there are designs for more extended functionalities in 3-D, or transformed spaces in the future ... so you will be the best judge on that.

tkmmark avatar Oct 11 '20 16:10 tkmmark

hi @tomvanmele what about this one? i like the cgal predicate thing, this is just about weeding out the issue tracker bit by bit

jf--- avatar Apr 08 '24 18:04 jf---

it is no longer relevant with refactoring to compas 2

tomvanmele avatar Apr 08 '24 20:04 tomvanmele