Jump to content
AntoineSfx

Discretize 2d shapes

Recommended Posts

Posted (edited)

Given a shape, how could you process it to make it a good starting point for copying those various elements at its points ?

At first it looked like something related to the Bresenham algorithm, but neighbor pieces have  to have one common edge.. The anti aliasing algorithm avoids such situation, so it won't work

I wonder what other mathematical problem this is related to.Could it be as simple as a snap (fuse), 

to a grid, then take care of the 45 degree edges ? I'm trying to have a polygon that is made only of segments oriented along one axis only at a time, and is an approximation of the initial geometry.

snap.thumb.png.ea348979c66e74ec4a4f2b8719f725bf.png

 

majokit.thumb.jpg.44c6d75a7c354b57f580354c64134b95.jpg

Edited by AntoineSfx

Share this post


Link to post
Share on other sites

Hi Antoine,

to pixelate a curve put a grid on top of it and remove primitives by their distance to the curves surface before removing shared edges with the divide SOP.

if(xyzdist(1, v@P) > 0.01) removeprim(0, @primnum, 1);

image.png.205ed664f0227529d06a80a2971d5a1d.png

 

gridify_curve.hipnc

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×