Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Add the Mirror node

Open 0HyperCube opened this issue 2 years ago • 4 comments

This node should take in vector data, a boolean for "Mirror X", and a boolean for "Mirror Y". The centre of transformation should probably be around the pivot (indicated in the document with a blue circle inside another blue circle). pivot If both mirror x and y are active, 4 copies of the vector data will be output. The default values should be true for mirror x and false for mirror y. This is similar to the mirror node in blender.

A guide to the node system can be found https://github.com/GraphiteEditor/Graphite/blob/master/node-graph/README.md - if you have any questions please ask in the discord chat.

Steps:

  • Define a new node that just outputs the vector data that has been input (to ensure nodes are set up properly). This is similar to the circular repeat node.
  • Compute the pivot position of the vector data using the appropriate function. You can log this to ensure that it is correct.
  • Clone the subpaths in the vector data and mirror all of the positions around the computed pivot. You may need to modify the bézier_rs library and the VectorData struct.

0HyperCube avatar Nov 13 '23 21:11 0HyperCube

Hey, I'd like to work on that issue :)

unholyleona avatar Nov 13 '23 21:11 unholyleona

@unholyleona If you need any help, feel free to submit a draft PR.

0HyperCube avatar Nov 25 '23 16:11 0HyperCube

@skoriop please comment "Ok" so I can assign you to this issue.

Keavon avatar Mar 02 '24 23:03 Keavon

Ok

skoriop avatar Mar 03 '24 13:03 skoriop