Repository navigation
feat(objects): smooth an object along a ztrace in 3D - #177
Merged
Merged
Conversation
Object attributes > Smooth along ztrace... stores a source ztrace, an optional target ztrace and a window on the object. When the 3D scene or mesh export meshes it, each section is shifted from its source point to the target point, or to a smoothed copy of the source fitted against section depth. Traces, section transforms, the object list and its measurements do not change. Exported meshes carry _smooth<N> or _smooth-<target> in the file name, and the mesh data export gains a ZtraceSmoothing column. Remove ztrace smoothing clears it; undo reverts either.
Export scene names a smoothed mesh <obj>_smooth<N> or _smooth-<target>, alone and in the combined file. The coordinate readout and double-click take the shift back off. Renaming a ztrace updates the settings that name it; deleting one clears them in the same undo step, with a notice. A setting that cannot be applied meshes as traced with a warning naming the object. Series import skips the setting and lists the objects. The window counts ztrace points, and the dialog shows how deep N points reach. The manual says the measurement columns are unchanged.
The 3D scene keeps the depth each section was meshed at and reads a point's section from it. The readout, the smoothing shift it takes off and the section a double-click opens are then right when section thicknesses differ. Renaming a ztrace moves its attributes, such as its alignment, to the new name in the same undo step. Export scene refuses, naming both objects, when two would be saved to one file. The manual says a scene file keeps its name and labels each smoothed object inside.
The 3D readout no longer shows x and y for an object smoothed along a ztrace: a point on a shifted mesh has no exact field coordinate. It shows the name, the smoothing label and the section, and double-click still goes to that section. Traced objects keep x and y. A point on a deleted section reads "(removed)", and double-click asks to generate the object again. The object list mesh export refuses two objects that would save to one file, with the same check as the scene export.
A smoothed object is saved as <name>_smooth<N>, so exporting it into a folder that already held that file from a traced object of that name replaced the file without a word. The object-list export and Export scene now check the folder with the shared clash check before writing anything, and refuse with a message that names the object and the file. Export scene checks each object's obj and mtl files, which it writes before it makes the scene file.
A field with a comma in it, such as the label smooth-hand,edit from a target ztrace named hand,edit, was split into two columns. Rows are now written with csv.writer, which quotes such a field; other rows are written as before.
A mesh export from the object list, or the per-object files of Export scene, that would write onto files already in the folder now shows one dialog that lists every such file, with Overwrite and Cancel. Cancel writes nothing; Overwrite replaces them as before. Two objects that map to one file are still refused. notifyConfirm takes an optional label for its OK button.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Smooth along ztrace...andRemove ztrace smoothingunderObject attributes, as in Reconstruct. You choose a source ztrace, an optional target and a window (default 4). Only the 3D scene and mesh export apply the shift; traces, alignments and the object list's measurement columns are unchanged. Mesh files end in_smooth<N>or_smooth-<target>, and a scene file labels each smoothed object. Mesh export asks before replacing existing files.Closes #125.