Subject: [ggl] RE: A few Boost.Geometry questions
From: Simonson, Lucanus J (lucanus.j.simonson)
Date: 2010-09-30 13:28:28
Bruno Lalande wrote:
>> Concept refinement handles cases where 3D points need to be used in
>> 2D algorithms. ?For things like properties if your algorithm
>> modifies the geometric content of the argument passed by reference
>> the properties will be preserved. ?We could think of the z as a
>> property in this case. ?If it constructs new ones in the output the
>> properties won't be transferred to the output. ?If it uses the copy
>> constructor to construct the new ones it would. ?If you want to
>> support this kind of thing you'll need to test for it since it os
>> easy to overlook.
> Actually I'm not sure what you want exactly here, Bill. Let's say you
> want the intersection between a shape made of such 2D points with a z
> value and another 2D shape (with no z values, or z values you don't
> care about). If the algorithm must create a point in the middle of a
> segment of the first shape and the z values of the ends of this
> segment are 10 and 20, do you want the created point to have z value
> 15? If yes, it sounds like you simply need an algorithm taking a 3D
> geometry on one hand and a 2D geometry on the other hand, right?
Concept refinement would result in output points with no Z in the case you describe since we must construct them and cannot copy construct them. Even if we did we could not interpolate. With this example we are dancing in the direction of meshing algorithms. What the user really wants is a mesh algorithm that merges the two 2D meshes and then interpolates properties on the original vertices when forming new vertices. Ideally the properties and method for intermpolating them would be parameterized. Real meshing tools work this way and provide a C interface, but come at a steep licensing cost. As a practical matter the interpolation can be performed as post processing of the output of the purely 2D algorithm by looking up the original objects based on the output geometry and back annotating the output data structure with the desired properties and interpolating them as needed.
Geometry list run by mateusz at loskot.net