Crop2D - Only working on one axis

Feel free to ask any question here
Post Reply
BSHF1
Posts: 3
Joined: Mon Nov 11, 2024 6:27 am

Crop2D - Only working on one axis

Post by BSHF1 »

Hi all,

I am having some issues with crop2D. For some reason I can crop on the Z-axis without problems (examples below), however, when I try to crop on the y axis, I get the error "No point of cloud ___ falls inside the input box".

I have tried multiple steps to fix this
  • Testing other axes (same problem)
    Setting Global shift settings in the command line i.e. "-O -GLOBAL_SHIFT -255327.00 -5745249.00 0"
    Adjusting all of the vertices for the crop 2D parameters by the global shift settings
    Using other point clouds
    Creating the polyline using the point-picking tool rather than the segmentation tool
    Retracing the polyline
Any help on this would be much appreciated, thank you for taking the time to read this. Let me know if there is any further information I can provide.


Notes
  • Global shift scale parameters: X: -255327.00 y: -5745249.00 Z: 0 Scale: 1
    The bounding box of the whole dataset:


Here is the working command

C:\Program Files\CloudCompare>CloudCompare -O "C:\Users\s222530217\Desktop\DB_PC\2023_09_22\Anglesea_Demons_Bluff_22_Sep_2023_LAZ_GDA94_MGA_zone_55_56_623_649_points.laz" -CROP2D Z 10 255168.29220581 5745094.46105957 255517.68377686 5745337.30992889 255789.87503052 5745463.22987366 256139.93103027 5745611.95510864 256112.26977539 5745672.54879761 255755.51214600 5745530.56759644 255502.54090881 5745408.42892456 255343.73398209 5745300.40045166 255224.40605164 5745224.90223885 255121.38977051 5745144.55060577

Here is the command I am having problems with
CloudCompare -O "C:\Users\s222530217\Desktop\DB_PC\2023_09_22\Anglesea_Demons_Bluff_22_Sep_2023_LAZ_GDA94_MGA_zone_55_56_623_649_points.laz" -CROP2D Y 37 255126.34300232 8.56400013 255140.61599731 6.06500006 255131.92799377 6.66200018 255161.58700562 11.45699978 255179.89199829 13.23999977 255193.99499512 13.31799984 255232.86799622 15.47599983 255270.41299820 17.27599907 255294.67699814 17.77700043 255319.39599991 17.01099968 255378.27099991 15.63700008 255420.99600220 16.57600021 255443.11900330 15.80599976 255468.41999817 13.93200016 255495.89199829 15.19200039 255529.04699707 18.02499962 255559.58099365 21.70899963 255580.16700745 21.18700027 255635.30899048 21.62899971 255641.17199707 20.84900093 255668.84500122 19.48200035 255719.17300415 17.52099991 255821.92199707 19.23500061 255919.49200439 21.29800034 255975.03997803 22.16099930 256136.56500244 21.04599953 256170.35498047 23.28400040 256226.60400391 25.51399994 256277.89599609 28.00900078 256350.97998047 25.70199966 256375.68298340 17.82900047 256400.69995117 10.54699993 256415.35900879 2.38199997 256472.79602051 22.12800026 256443.92602539 0.12600000 255126.15299988 -0.34299999 255126.34300232 8.56400013

Here are the vertices of my most recent polyline, created by point-picking
255126.34300232 5745020.77900696 8.56400013
255140.61599731 5745079.30400085 6.06500006
255131.92799377 5745108.83099365 6.66200018
255161.58700562 5745131.02600098 11.45699978
255179.89199829 5745141.70200348 13.23999977
255193.99499512 5745171.06099701 13.31799984
255232.86799622 5745198.55300140 15.47599983
255270.41299820 5745218.87000084 17.27599907
255294.67699814 5745241.41200018 17.77700043
255319.39599991 5745255.13700008 17.01099968
255378.27099991 5745298.83200073 15.63700008
255420.99600220 5745328.02500153 16.57600021
255443.11900330 5745338.34100342 15.80599976
255468.41999817 5745355.20800018 13.93200016
255495.89199829 5745367.95700073 15.19200039
255529.04699707 5745388.09300232 18.02499962
255559.58099365 5745402.85000610 21.70899963
255580.16700745 5745413.56100464 21.18700027
255635.30899048 5745443.36999512 21.62899971
255641.17199707 5745450.15699768 20.84900093
255668.84500122 5745463.04100037 19.48200035
255719.17300415 5745482.16200256 17.52099991
255821.92199707 5745527.85501099 19.23500061
255919.49200439 5745561.55398560 21.29800034
255975.03997803 5745583.84799194 22.16099930
256136.56500244 5745646.38900757 21.04599953
256170.35498047 5745653.01501465 23.28400040
256226.60400391 5745691.22399902 25.51399994
256277.89599609 5745721.98199463 28.00900078
256350.97998047 5745747.65600586 25.70199966
256375.68298340 5745741.72000122 17.82900047
256400.69995117 5745738.92300415 10.54699993
256415.35900879 5745729.97500610 2.38199997
256472.79602051 5745810.61199951 22.12800026
256443.92602539 5745696.64898682 0.12600000
255126.15299988 5745036.50599670 -0.34299999
255126.34300232 5745020.77900696 8.56400013


Images
Whole cloud
Whole cloud.PNG
Whole cloud.PNG (172.87 KiB) Viewed 497 times
Cropped cloud - Z axis
cropped cloud.PNG
cropped cloud.PNG (333.34 KiB) Viewed 497 times
Successful crop polyline
Succesful crop.PNG
Succesful crop.PNG (382.98 KiB) Viewed 497 times
Unsuccessful crop polyline
Failed crop_pointpicked.PNG
Failed crop_pointpicked.PNG (235.81 KiB) Viewed 497 times
Error
error.PNG
error.PNG (70.3 KiB) Viewed 497 times
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crop2D - Only working on one axis

Post by daniel »

Is it related to the Global Shift maybe? Normally, you should handle it in the command line mode as well (with '-O GLOBAL_SHIFT AUTO' or another option). If you don't, the digits of the large coordinates are truncated and this may mess with the crop tool as well?

If it's still behaving the same, would you mind sending me the cloud you used with the Y direction? (to admin@cloudcompare.org)
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crop2D - Only working on one axis

Post by daniel »

Thanks for the data. It helped me understand why it didn't work on your side.

First, if you apply a Global Shift at loading time (which is mandatory for keeping the data accuracy), the coordinates of the polyline vertices should be expressed in the local/shifted coordinate system! I realize it can be cumbersome, therefore I added a -GLOBAL_SHIFT option (similar as the one after -O) to apply the same Global Shift to the vertices as to the point cloud.

Then, something that was not explained in the wiki: if you set the Y dimension, CloudCompare expects the coordinates of the 2D points to be 'Z, X' and not 'X, Z'... That was tricky.

Once again, I added 3 new options to set the dimensions: Xflip, Yflip, Zflip (to invert what CC expects, and let you keep the coordinates as you've wrote them).

You can test this new version here: https://www.cloudcompare.org/release/Cl ... up_x64.exe

See the updated wiki as well: https://www.cloudcompare.org/doc/wiki/i ... _line_mode

And last, your command line should now look like:

Code: Select all

CloudCompare -O -GLOBAL_SHIFT -255327.00 -5745249.00 0 Anglesea_Demons_Bluff_22_Sep_2023_LAZ_GDA94_MGA_zone_55_56_623_649_points.laz -CROP2D Yflip -GLOBAL_SHIFT FIRST 37 255126.34300232 8.56400013 255140.61599731 6.06500006 255131.92799377 6.66200018 255161.58700562 11.45699978 255179.89199829 13.23999977 255193.99499512 13.31799984 255232.86799622 15.47599983 255270.41299820 17.27599907 255294.67699814 17.77700043 255319.39599991 17.01099968 255378.27099991 15.63700008 255420.99600220 16.57600021 255443.11900330 15.80599976 255468.41999817 13.93200016 255495.89199829 15.19200039 255529.04699707 18.02499962 255559.58099365 21.70899963 255580.16700745 21.18700027 255635.30899048 21.62899971 255641.17199707 20.84900093 255668.84500122 19.48200035 255719.17300415 17.52099991 255821.92199707 19.23500061 255919.49200439 21.29800034 255975.03997803 22.16099930 256136.56500244 21.04599953 256170.35498047 23.28400040 256226.60400391 25.51399994 256277.89599609 28.00900078 256350.97998047 25.70199966 256375.68298340 17.82900047 256400.69995117 10.54699993 256415.35900879 2.38199997 256472.79602051 22.12800026 256443.92602539 0.12600000 255126.15299988 -0.34299999 255126.34300232 8.56400013
Daniel, CloudCompare admin
BSHF1
Posts: 3
Joined: Mon Nov 11, 2024 6:27 am

Re: Crop2D - Only working on one axis

Post by BSHF1 »

Thank you so much for the clear explanation and the update! The details about the Global Shift and the coordinate expectations for the Y dimension were super helpful.

The new flip options are a fantastic addition and will make things so much easier. I really appreciate the updated version and the link to the wiki. It all works now —thanks for making CloudCompare even better! 🙌
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Crop2D - Only working on one axis

Post by daniel »

You're welcome. Feedback is always appreciated.
Daniel, CloudCompare admin
Post Reply