You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are in the process of using the transformations from Meshes directly, but it means the package will not be compatible with CoordinateTransformations out-of-the-box anymore. Document how we can use such transformations instead.
The issue comes from the fact that we apply the transformation on the points directly, in the apply_transformation internal function:
functionapply_transformation(transformation, ref_mesh)
Meshes.SimpleMesh([transformation(p) for p in ref_mesh.vertices], Meshes.topology(ref_mesh))
end
The thing is CoordinateTransformations does not know how to be applied over Meshes.Point3, so we need to operate the transformation on the coordinates of the points instead, like so:
functionapply_transformation(transformation, ref_mesh)
Meshes.SimpleMesh([transformation(p.coords) for p in ref_mesh.vertices], Meshes.topology(ref_mesh))
end
But we can't apply the transformation from Meshes like so (don't know why, but the results are wrong, I don't have the time to investigate more).
So the solution is to keep applying the transformation on the points, but ask users to adapt a little bit the CoordinateTransformations transformation to manage Points. For example, to apply a rotation and a translation over a point, we can ask to wrap the transformation in a function and return a Meshes.Point like so:
mat =randn(4, 4)
transformation = x -> Meshes.Point3((Translation(@view mat[1:3, 4]) ∘LinearMap(@view mat[1:3, 1:3]))(x.coords))
And then we can use the transformation directly on a Meshes point:
transformation(Meshes.Point3(1, 2, 3))
The text was updated successfully, but these errors were encountered:
Update: the geometry only accepts Transformations from TransformsBase / Meshes now, so we need to set a wrapper Transformation around the CoordinateTransformation.jl ones.
We are in the process of using the transformations from Meshes directly, but it means the package will not be compatible with CoordinateTransformations out-of-the-box anymore. Document how we can use such transformations instead.
The issue comes from the fact that we apply the transformation on the points directly, in the
apply_transformation
internal function:The thing is
CoordinateTransformations
does not know how to be applied over Meshes.Point3, so we need to operate the transformation on the coordinates of the points instead, like so:But we can't apply the transformation from Meshes like so (don't know why, but the results are wrong, I don't have the time to investigate more).
So the solution is to keep applying the transformation on the points, but ask users to adapt a little bit the CoordinateTransformations transformation to manage Points. For example, to apply a rotation and a translation over a point, we can ask to wrap the transformation in a function and return a Meshes.Point like so:
And then we can use the transformation directly on a Meshes point:
The text was updated successfully, but these errors were encountered: