Replies: 4 comments 7 replies
-
Which algorithms and geometries are you using in 2d and which in 3d? |
Beta Was this translation helpful? Give feedback.
-
I can't use them in 3D I have to convert first. This is the conversion I would like to avoid, to have for example a rotate with my 3d points I get from another source, then a difference, then a buffer without touching the z points (they remain at the same height anyway) for the 2d algorithms. |
Beta Was this translation helpful? Give feedback.
-
Technically it should be possible to implement 2D views for all of the types. Types which contain references or pointers to the original 3D geometries and return non-true references instead. I know that some users have done this but I don't know if all of the parts of the library will work properly because this use case is not tested. So something like this class which only works for points: I'm also not sure if this is doable for mutable geometries and whether it'd require fixing some of the algorithms to work with non-true mutable references properly. |
Beta Was this translation helpful? Give feedback.
-
Just an update: I think it could be easier to add a flag "IMPLICITLY_CONVERT_TO_2D" before including the lib. If a new array needs to be created, we read the decltype of the incoming element and reuse that, and still only set the 2d variables, leaving the rest uninitialized (not sure we can do otherwise). Otherwise, if we can modify in place, don't touch the rest. How hard would it be? The direct way is to bypass the dimensional assertion with that flag to true. Again, the net result is the speedup from not having to copy values around when we need different dimensions in a chain of logic. |
Beta Was this translation helpful? Give feedback.
-
Hi,
For some reasons (one allocation for geometrical multi stage analysis.. ) , one may need to import and allocate geometries with 3d points but apply 2d algorithms on them.
It would be really nice if we could have, eg, a polygon of 3d points being 2d corrected and managing to access all the 2d algorithms.
It is needed when multi staging a geometric structure. Because at some stages, only the 2d points are of importance. No matter the height, we want to be able to cut "from the top view".
That will avoid costly conversions just because the library will stop you from doing otherwise.
The only thing we need to have is a strategy stating that the 3rd point is not used. No more error prone conversions, ad hoc structures to remember the z value and so on.
We could add one stage of complexity stating which axis is which but I guess that is going too far.
I had a look at the code and it is really locked as is, with the logic I complain about.
Maybe someone has an idea to make it happen without rewriting everything?
Beta Was this translation helpful? Give feedback.
All reactions