I'm trying to map the output points of the triangulation to the input points, but that is not easy apparently!
A simple example I thought would work:
#[derive(Copy, Clone)]
struct PointLink {
x: f32,
y: f32,
// Index to the original point in the vertex buffer that was used to create this
original_index: u32,
}
impl FloatPointCompatible for PointLink {
type Scalar = f32;
fn x(&self) -> Self::Scalar {
self.x
}
fn y(&self) -> Self::Scalar {
self.y
}
// This gets called inside of a triangulation despite not needing to create new points?
fn from_xy(x: Self::Scalar, y: Self::Scalar) -> Self {
panic!("Should not be creating new points; Otherwise we don't know where the point is in the vertex array");
}
}
My use case is that I have a 3d model I want to triangulate, and then map the triangulation to 3d. However the from_xy function gets called, meaning we loose all context as to what the original vertex is.
Is there a different way to accomplish what I'm trying to do, or is this something that needs to be fixed?
I'm trying to map the output points of the triangulation to the input points, but that is not easy apparently!
A simple example I thought would work:
My use case is that I have a 3d model I want to triangulate, and then map the triangulation to 3d. However the
from_xyfunction gets called, meaning we loose all context as to what the original vertex is.Is there a different way to accomplish what I'm trying to do, or is this something that needs to be fixed?