Jump to content
Fool

Flattening mesh with RaySOP

Recommended Posts

Posted (edited)

Hey Odforce, first time poster here. 

I am having a difficult time flattening my polygonal mesh to a flat surface using the ray sop.
My goal is to have a flat mesh having the same shape my mesh had previous to the ray sop, but everything i can handle to create is this "squeezed" mesh as seen on the screenshot. 
I tried using the Project geometry node but couldnt get it to work either. 



 

RAYSOP.PNG

Edited by Fool

Share this post


Link to post
Share on other sites

Not sure what your problem is, but you can try setting Scale in Ray SOP to .999 to make sure the primitives from one side don't end up in the same plane (i.e. sharing the Y coordinate) as the primitives from the other side in the case you're projecting on a plane. See https://en.wikipedia.org/wiki/Z-fighting 

Share this post


Link to post
Share on other sites
Posted (edited)

You can wrangle this also, should be easier to set up :

vector min_p = detail(0, "P");
//if you want a certain threshold to control the point depending on its y position
//if (@P.y > min_p.y + ch("threshold")) @P.y = min__p.y;
@P.y = min_p.y;

With an attrib promote before the wrangle set up like this :

image.png.dfbb5d60c4298b1ff34db303ffbb5e75.png

 

Cheers,

Edited by DonRomano
syntax
  • Like 1

Share this post


Link to post
Share on other sites
On 27.8.2020 at 11:20 AM, DonRomano said:

You can wrangle this also, should be easier to set up :


float min_p = detail(0, "P");
//if you want a certain threshold to control the point depending on its y position
//if (@P.y > min_p.y + ch("threshold")) @P.y = min__p.y;
@P.y = min_p.y;

With an attrib promote before the wrangle set up like this :

image.png.dfbb5d60c4298b1ff34db303ffbb5e75.png

 

Cheers,

This worked out great for me. Thanks! :)

Share this post


Link to post
Share on other sites
On 8/27/2020 at 11:20 AM, DonRomano said:

You can wrangle this also, should be easier to set up :


float min_p = detail(0, "P");
//if you want a certain threshold to control the point depending on its y position
//if (@P.y > min_p.y + ch("threshold")) @P.y = min__p.y;
@P.y = min_p.y;

With an attrib promote before the wrangle set up like this :

image.png.dfbb5d60c4298b1ff34db303ffbb5e75.png

 

Cheers,

No.

You're assigning a point to a float.

Also , promoting a 3 component vector attribute to its minimum doesn't seem like a good idea.

Will it find the minimum value using a lexicographic comparison over R^3, or will it do it independently over each component ? The documentation  is not clear about it

Share this post


Link to post
Share on other sites
6 hours ago, AntoineSfx said:

No.

You're assigning a point to a float.

Also , promoting a 3 component vector attribute to its minimum doesn't seem like a good idea.

Will it find the minimum value using a lexicographic comparison over R^3, or will it do it independently over each component ? The documentation  is not clear about it

Yes, it was a syntax mistake. The minimum find algorithm looks for the minimum for each component, at least with my tests it's what it's doing. He said it was working fine, so I don't understand why you're digging old post to point out a syntax error

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

×