Difference between revisions of "Cross Section"

From CloudCompareWiki
Jump to navigation Jump to search
Line 20: Line 20:
 
A dedicated dialog will appear in the top-right part of the 3D view.
 
A dedicated dialog will appear in the top-right part of the 3D view.
  
Note: the initial clipping box is the cloud bounding-box.
+
Notes:
 +
* the initial clipping box is the cloud bounding-box.
 +
* since version 2.7, a button lets the user restore the clipping box defined '''on the same cloud''' during a previous call to this method (next to the 'reset' button, in the upper right part of the dialog).
  
 
== Editing the clipping box ==
 
== Editing the clipping box ==

Revision as of 05:00, 22 April 2016

Menu / Icon

This tool is accessible via the CcClippingBox small.png icon the upper main toolbar or the 'Tools > Segmentation > Cross Section' menu.

Description

This tool allows the user to define a clipping box (interactively or not) around a given cloud. The box extents and orientation can be adjusted in order to segment the cloud for instance.

Since version 2.6.2 this tool can be used on meshes.

Additionally, this tool can:

  • repeat the segmentation process in one or several dimensions (to extract multiple 'slices' for instances)
  • extract polygonal contours in each slice

Procedure

Select a single cloud and start this tool.

Cc cross section tool.jpg

A dedicated dialog will appear in the top-right part of the 3D view.

Notes:

  • the initial clipping box is the cloud bounding-box.
  • since version 2.7, a button lets the user restore the clipping box defined on the same cloud during a previous call to this method (next to the 'reset' button, in the upper right part of the dialog).

Editing the clipping box

The clipping box can be edited in various ways.

Interactively

You can drag the 'interactors' (big red, green and blue arrows and tori) so as to move the clipping box boundaries directly in the 3D view. The arrow tips are used to push and pull the clipping box faces, while the tori can be used to rotate the box around the arrow axes.

You can also translate the whole box with the lower-left (yellow) interactor.

Cc cross section tool edit.jpg

Note: you can show or hide the interactors and/or the box with the two icons on the top left part of the dialog.

Numerically

You can directly edit the box dimensions (width, depth and height) with the 'X', 'Y' and 'Z' fields.

You can also shift the box in all directions with the buttons in the lower part of the dialog ('Shift box' frame). The box will be shifted of the same quantity as the box width in this dimension.

Eventually, if you need more control, you can click on the 'advanced' button. A 'standard' 3D box edition dialog will appear. You can setup the box position in space in various ways (and even force the box to be cubical for instance).

Since version 2.6.3 you can also setup the box axes this way.

Cc cross section tool advanced dialog.jpg

Visualization

At any time the 3D view camera can be changed so as to face one of the clipping box faces. Use the standard 'predefined views' buttons in the lower part.

It can be useful to hide the interactors as well in order to properly see the current cloud section:

Cc cross section tool section view.jpg

Extract a single slice

Once the clipping box is defined, you can export the visible cloud subset as a new cloud.

To do this, simply click on the 'Export slice' CcClippingBoxSingleExport small.png button (in the right 'Slices' frame). CloudCompare will then create a new cloud and add it to the database tree.

Since version 2.6.2 this can also be performed on meshes. And while the real-time visualization simply hides the triangles that are falling on the border or outside of the clipping box (for the sake of speed), the output 'slice' will have a clean cut. All triangles falling on the border will be properly re-meshed. This is the same behavior as the Crop method.

Extract a single contour

Instead of the subset of points corresponding to the current slice, it is also possible to extract the (closed) contour of the points.

To do this click on the 'Extract contour' SmallPolygonSelect.png button (in the left 'Contour' frame).

A dialog to setup the contour extraction process will appear:

Cc cross section tool extract contour dialog.jpg

The user must set:

  • the 'flat' dimension (it should be automatically setup based on the current section dimensions).
  • the maximum edge length: the contour is extracted thanks to a 'concave hull' algorithm. The only parameter for this tool is the 'maximum size' of a single edge (if possible). The algorithm starts from the convex hull of the slice points. As long as an edge is longer than the specified 'max length', the algorithm will try to split it by using another point in the vicinity. This way the contour will fit the cloud more tightly. So the smaller the parameter is, the tighter the contour will be. Note that this 'maximum length' can't be guaranteed as only the input points are used.

Additional options are:

  • project slice(s) points on their best fit plane: the contour extraction is done in 2D. Instead of using the slice flat dimension as projection plane, CloudCompare can project the points on their best fit plane (it can be sometimes better for very thick slices).
  • split contour(s) on longer edges: CloudCompare can split the contour every time an edge is longer than the 'maximum edge length' parameter. In this case multiple non-closed polylines can be generated instead of a single closed contour.
  • visual debug mode: for debug use (can be used to understand why the algorithm doesn't output what one would expect).


Extracted contour (close-up with the slice cloud)


Notes:

  • you can easily 'cancel' (delete) the last generated contour by clicking on the 'revert' icon next to the SmallPolygonSelect.png button
  • to extract a non-closed contour, see the Extract Sections tool.

Extract several slices or contours

To extract several slices or contours at once, click on the 'Extract multiple slices' CcClippingBoxMultExport small.png icon (in the right 'Slices' frame).

CloudCompare will open a dialog:

Cc cross section tool repeat dialog.jpg

Most of the parameters are the same as for the 'Single section extraction' dialog (see above).

The user must however explicitly specify if he wishes to generate contours (check the 'Extract contour(s)' checkbox to enable the associated frame). Otherwise only slices will be generated.

Other parameters are:

  • Repeat dimension: the extraction process can be repeated in one or multiple dimensions (by default only the 'flat' dimension will be checked)
  • Gap: a gap can be added between each slice
  • random colors per slice: if checked, a random color will be assigned to each slice (warning: any existing colors will be overwritten!)
Multiple slices (left) and contours (right) extraction

Reset the clipping box

You can reset the clipping box to its original state (i.e. the cloud bounding-box) anytime by clicking on the 'reset' SmallReset.png button in the upper right part of the dialog.

Close the tool

You can close the tool by clicking on the 'red cross' SmallCancel.png button in the upper right part of the dialog.