LDCad Advanced rotation techniques


RE: Advanced rotation techniques
#7
(2022-07-23, 19:20)Roland Melkert Wrote: The attached script levels (3 items of) the selection.

The script takes 3 items from the selection and use them to get a plane normal.
Then it uses one of the 2 triangle vectors as the x-axis to build an orientation matrix.

You'll have to rotate it around Y afterwards to get it on its final place.

The really cool thing would be to analyze the mesh (possible in 1.7 Alpha 2a) to get those 3 points automatically.

Nifty! So that makes the process:
  1. Set the part to be rotated at the origin, and place helper parts at its 3 low points—in this case determined by LDPE. (Hiding the ground tile for the moment…)
       
  2. Select the 3 helper parts and apply the script.
       
  3. Set the grid relative to the lowest helper part and copy its orientation. Set the main part's rotation center to the relative origin, then rotate it using the matrix option.
       
  4. Finally, translate everything upward so the helper parts are at y=0, then delete them. Voila! It's level.
       
So the only question now is, what happens if the ground isn't nice and smooth? Angel
   
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Advanced rotation techniques - by N. W. Perry - 2022-07-22, 13:40
RE: Advanced rotation techniques - by N. W. Perry - 2022-07-25, 2:50

Forum Jump:


Users browsing this thread: 1 Guest(s)