ICE Topology and parametric equations

Here you can find ICE tutorials and learning material
User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 15 Feb 2012, 03:00

Sure!

I will be interested to see what can be done with it. Happy Experimenting!

Cheers!

Dan
Attachments
Torus_Braided.xsicompound
(102.9 KiB) Downloaded 181 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 16:00

Re: ICE Topology and parametric equations

Post by TwinSnakes007 » 15 Feb 2012, 14:21

Daniel,

I was wondering if your compound created interior points inside the shape volume or does it just create the exterior/surface points?

I want to use your compound with some particle work I'm researching, but didnt know if your formulas also created interior points.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 15 Feb 2012, 14:41

My formulas do not create interior points, See it as a twisted plane ... a plane has no volume.

For that you need the implicit form of the formula.

If you have both formulas (parametric and implicit) you can create some tests:

If you want to test if an object is touching or on the surface, you use the parametric formula.

If you want to see if an object is inside or outside a volume or want to fill a volume, you would use the implicit formula.

Many objects have this property. For example the sphere:

The parametric formula is:

x = r cos (u) sin (v)
y = r cos (v)
z = r sin (u) sin (v)

and it's implicit form is

x^2 + y^2 + z^2 = r^2

r is the radius of the sphere.

So if I understand your question you want points inside a surface, so using the implicit form to fill the volume should work for your case. Hope that help!
Last edited by Daniel Brassard on 15 Feb 2012, 15:29, edited 2 times in total.
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 15 Feb 2012, 14:56

Some advice on the torus braided compound

In the figure below, I explained the effect of some of the parameters on the twisted torus.

The effect is controlled by two parameters and some silly calculations.

The number of twists control the amount of twists on the torus. In the figure below, this amount is 12.

The number of repetitions of the twists is controlled by the u parameter. In the figure, I did 10 repetitions (6.283 radians x 10 repetitions = 62.83 radians). Note 6.283 radians is 360 degrees.

In the figure, you will notice a fraction number after the number of twists. This control the amount of spacing between repetitions (compression factor).

the silly formula is:

number of twists plus compression factor divide by the number of repetitions

so

12 + compression / 10 in the figure below.

The compression factor is between a very small number (but not zero) and 1 (no compression
0 < compression <= 1 (no compression)

So in the figure below, with no compression the formulas would have been:

12 + 1/10 = 12.1 (uniform distribution of the repetitions on the twisted torus)

but I decided to compress the repetitions so the amount of compressions was 0.5, the formula become:

12 + 0.5 / 10 = 12.05 (as per the figure below)

You can modify the compound inside to do this calculation automatically if you wish.

Happy Experimenting!

Dan
Attachments
Torus_Braided3b.jpg
Torus_Braided3b.jpg (119.6 KiB) Viewed 3480 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 16:00

Re: ICE Topology and parametric equations

Post by TwinSnakes007 » 15 Feb 2012, 15:46

Daniel Brassard wrote:If you want to see if an object is inside or outside a volume or want to fill a volume, you would use the implicit formula.

x^2 + y^2 + z^2 = r^2

r is the radius of the sphere.

So if I understand your question you want points inside a surface, so using the implicit form to fill the volume should work for your case.
Yes, I want to fill a volume of an implicit surface with points, but how would I control the density of the points? Please dont say "marching cubes".

Edit: Was thinking we could expand on "Generate 3D Point Grid" to include some of your shapes.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 15 Feb 2012, 18:29

Yes, I want to fill a volume of an implicit surface with points, but how would I control the density of the points? Please dont say "marching cubes".
If you wanted to fill the volume like a solid, yes, the marching cube would be the direction to take but for your case you don't need to do that.

What you do is solve the implicit equation and testing the result to make sure it remain lower or equal to a set of criteria.

For example, take the sphere equation, you would feed random values of x, y and z and calculate

x^2+y^2+z^2

test if the result is lower or equal to r^2.

x^2 + y^2 + z^2 <= r^2

If yes, put the point inside the sphere, if not, reject the result, select random values of x, y and z and start again.

As a side note, random values between 0 and 1 in x, y, z are creating a point cloud inside a cube. The process is the same.

A point cloud inside any geometry is using the geometry as a bounding shape for your point cloud, basically softimage test if the point cloud is inside the shape, anythin outside get culled.

So you could use a closed geometry created parametrically as a bounding shape for your point cloud!

I will do a little ICE tree to demonstrate the process tonight. Very simple realy.

Hope this explaination help!
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 16:00

Re: ICE Topology and parametric equations

Post by TwinSnakes007 » 15 Feb 2012, 18:37

Thanks, an example would really help alot! \:D/

Edit: Okay, I think I get what your saying, for example: lets say I create a 10x10x10 grid of points spread 1 unit part, and this would act as my bounding box. Now, if I wanted to create an implicit sphere from that, I would test each point to see if it satisfies the implicit equation x^2 + y^2 + z^2 <= r^2, if it does - keep it, if it doesnt - delete it.

If that's true, then that's exactly what I wanted. I would still have control over the point density, and by simply changing the implicit equation, I can get different shapes of points in a volume.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 15 Feb 2012, 19:49

Yes, that is the jest of it.

The trick is to make the box of random points as close to the sphere or object boundary as possible to minimise the amount of rejects (that is why polygonizers are using bounding box).

For the sphere, the test x^2 + Y^2 + z^2 greater than r^2 should suffice i.e reject anything greater than r^2. Create the array of points until you have reach the amount of points you wanted.

An other way to represent the formula is

x^2 + y^2 + z^2 - r^2 = 0 then if you test the equation and discard anything greater than zero, you will get the sphere volume.

Not all implicit functions will be closed. Some shapes are deformed plane with no in/out (caley surface, bath sextic, etc). Choose a close surface if possible. If you generate enough points and only keep those that are within a small range limit of the surface, you could generate those shapes with a tight point cloud BTW.

example for the sphere keep only the points that are within X^2 + y^2 +z^2 = R^2 plus or minus .00001 (tolerance) i.e.

r^2 - 0.00001 < x^2 + y^2 + z^2 < r^2 + 0.00001

Keep in mind that this is processing intensive, it may be slow to generate the point cloud (cache the point cloud if you are going to animate it).

Also, if you have emPolygoniser, you can use it to create shapes from implicit formula.
(maybe I need to open a separate thread to show how it's done). I think emPolygoniser is based on the marching cube or marching tetra but i am not sure.

Good luck!
Last edited by Daniel Brassard on 16 Feb 2012, 05:10, edited 2 times in total.
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 16 Feb 2012, 05:03

As promise below is the ICE tree that you need to construct to create implicit form.

I have created the sphere as an example for you to try.

You will need some way to create a 3D grid of points in x, y and z. You can modify the factory 3D point grid but I don't like the inside. So here is mine. It is built on a variation of the modulo trick, so this is a fast point generator, no repeat node inside.
Attachments
Implicit.jpg
Implicit.jpg (67.49 KiB) Viewed 3360 times
XYZ_Grid_Generator.xsicompound
(44.5 KiB) Downloaded 140 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 16 Feb 2012, 05:06

And here is the result and for good measure I also applied empolygonizer on it. Work like a charm!

Hope you will have fun with this, I surely will try some new shapes with this ICEtree!

Cheers!

Dan
Attachments
Implicit2.jpg
Implicit2.jpg (73.23 KiB) Viewed 3360 times
Implicit3.jpg
Implicit3.jpg (110.85 KiB) Viewed 3360 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 18 Feb 2012, 01:21

Pretzel

Using the above technique and ICETree, I tested another implicit formula taken from Paul Bourke Website.

The implicit equation for the pretzel is:

(x^2 * (1-x^2) - y^2)^2 + z^2 = 0.01

Using the formula, I created the ICE tree below and made it into a compound. I then connected the compound like the previous sphere implementation.

Note that I moved the right side of the equation to the left side for convenience.
Attachments
Pretzel_Implicit.jpg
Pretzel_Implicit.jpg (69.54 KiB) Viewed 4091 times
Pretzel1.jpg
Pretzel1.jpg (55.22 KiB) Viewed 4091 times
Last edited by Daniel Brassard on 18 Feb 2012, 01:27, edited 2 times in total.
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 18 Feb 2012, 01:24

And, here is the point cloud and emPolygonizer results. Pretty good for a proof of concept. A lot of possibilities, the door is wide open.

Cheers!

Dan
Attachments
Pretzel2.jpg
Pretzel2.jpg (76.67 KiB) Viewed 4091 times
Pretzel3.jpg
Pretzel3.jpg (54.26 KiB) Viewed 4091 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 16:00

Re: ICE Topology and parametric equations

Post by TwinSnakes007 » 18 Feb 2012, 01:49

Very nice Daniel! Implicit surfaces in SI. Who knew!? :p

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 23 Feb 2012, 05:22

Implicit ICE Tree improvement

After further testing, and multiple crashes, I found that using the IF node did not work because I was keeping the entire array and not discarting any points, in fact I was compacting the points that did not meet the IF condition to location 0,0,0.

So I modified the ICETree as follows and tested it with a Cosine function. It worked with better results at high numbers of points, and I discard the points that don't meet the condition reducing the size of the point cloud array. Unfortunately, my low spec machine cannot polygonise the shape due to lack of memory. I will leave that to those adventurers with higher spec machines.

Cheers!

Dan
Attachments
Implicit4.jpg
Implicit4.jpg (57.26 KiB) Viewed 4001 times
Implicit5.jpg
Implicit5.jpg (87.5 KiB) Viewed 4001 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: ICE Topology and parametric equations

Post by Daniel Brassard » 23 Feb 2012, 05:37

And for comparaison, here is the upgraded ICETree of the Pretzel. Much faster to polygonize!
Attachments
Bretzel4.jpg
Bretzel4.jpg (55.18 KiB) Viewed 4000 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
ActionArt
Posts: 853
Joined: 25 Nov 2010, 18:23
Location: Canada

Re: ICE Topology and parametric equations

Post by ActionArt » 02 Apr 2012, 22:41

Daniel, are you still going on this? I kind of missed seeing it lately ;)

I hope you still plan to package those fine compounds someday...

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests