Skip to content

Commit f639855

Browse files
committed
Start sketing frame correction property
1 parent 25b6aa1 commit f639855

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libopensimcreator/UI/ModelWarper/ModelWarperTab.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ namespace
184184
// Figure out the transform between the input mesh and the landmarks frame
185185
const auto mesh2landmarks = to<Transform>(inputMesh.getFrame().findTransformBetween(state, landmarksFrame));
186186

187-
// Warp the verticies in-place.
187+
// Warp the vertices in-place.
188188
auto vertices = mesh.vertices();
189189
for (auto& vertex : vertices) {
190190
vertex = transform_point(mesh2landmarks, vertex); // put vertex into landmark frame
@@ -424,6 +424,7 @@ namespace
424424
OpenSim_DECLARE_PROPERTY(source_landmarks_file, std::string, "Filesystem path, relative to the model's filesystem path, where a CSV containing the source landmarks can be loaded from (e.g. `Geometry/torso.landmarks.csv`)");
425425
OpenSim_DECLARE_PROPERTY(destination_landmarks_file, std::string, "Filesystem path, relative to the model's filesystem path, where a CSV containing the destination landmarks can be loaded from (e.g. `DestinationGeometry/torso.landmarks.csv`)");
426426
OpenSim_DECLARE_PROPERTY(landmarks_frame, std::string, "Component path (e.g. `/bodyset/somebody`) to the frame that the landmarks defined in both `source_landmarks_file` and `destination_landmarks_file` are expressed in.\n\nThe engine uses this to figure out how to transform the input to/from the coordinate system of the warp transform.");
427+
OpenSim_DECLARE_PROPERTY(compensate_for_frame_warping, bool, "If `landmarks_frame` is different from the warped data's frame, and previous scaling steps has caused the spatial transform between the two to change, compensate for it by inverse-applying the warp transform to this data, so that the effect of frame warping is compensated for. This can be necessary to stop double-warping for occurring");
427428
OpenSim_DECLARE_PROPERTY(source_landmarks_prescale, double, "Scaling factor that each source landmark point should be multiplied by before computing the TPS warp. This is sometimes necessary if (e.g.) the mesh is in different units (OpenSim works in meters).");
428429
OpenSim_DECLARE_PROPERTY(destination_landmarks_prescale, double, "Scaling factor that each destination landmark point should be multiplied by before computing the TPS warp. This is sometimes necessary if (e.g.) the mesh is in different units (OpenSim works in meters).");
429430

@@ -436,6 +437,7 @@ namespace
436437
constructProperty_source_landmarks_file({});
437438
constructProperty_destination_landmarks_file({});
438439
constructProperty_landmarks_frame("/ground");
440+
constructProperty_compensate_for_frame_warping(true);
439441
constructProperty_source_landmarks_prescale(1.0);
440442
constructProperty_destination_landmarks_prescale(1.0);
441443
}

0 commit comments

Comments
 (0)