Move_to Node

john's Avatar

john

13 Jul, 2021 04:11 AM

This happens often: I have a shape, not centered on the origin, and I want to move it to a particular location.

To do this very simple thing I have to:

  • find the centroid of the shape
  • calculate the relative position change. The easiest way to do this is:
    • open Cartan Node Library
    • copy my rel_change node
    • paste it back in my project
  • add a translate node and translate the shape using the output of rel_change

When this happened for the twelve hundredth time I finally decided just to make a new node to do this in one fell swoop. Saves time and also results in cleaner code.

move_to will appear in the next release of the Cartan Node Library. But if you need to move a shape now, you can copy it from the attached demo.

Enjoy!

John

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • move_to_screenshot.png 387 KB
  • move_to_node.zip 3.6 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

16 Jun, 2022 05:30 AM
15 Jun, 2022 06:03 AM
06 Jun, 2022 01:07 PM
02 Jun, 2022 11:58 PM
30 May, 2022 07:48 AM

 

24 May, 2022 06:27 PM
20 May, 2022 04:12 PM
05 May, 2022 02:25 AM
03 May, 2022 04:46 AM
01 May, 2022 09:22 AM
18 Apr, 2022 09:01 PM