Jump to content
jingyisw

How to perfect fractured a sphere into tetrahedrons ?

Recommended Posts

i recently saw a reel . Some sort of abstract effect . and i just wanna know

 How to perfect fractured a sphere into tetrahedrons ?  Is there anyone have

solutions to do this ? Please help me .:ph34r:

Share this post


Link to post
Share on other sites

If you add a name attribute to your primitives column of the geometry spreadsheet, the Exploded View SOP will pick up on that and allow you to push faces out for further operations. When a primitive has this attribute, tools essentially treat them similar to fracture pieces. Remember to set the mode of the Attribute Wrangle to Run Over Primitives.

s@name = sprintf("detect_me_%d",@primnum);

Untitled-2.jpg

ap_exploded_view.hipnc

Edited by Atom
  • Like 1

Share this post


Link to post
Share on other sites
On 2016/6/18 at 8:23 PM, Atom said:

If you add a name attribute to your primitives column of the geometry spreadsheet, the Exploded View SOP will pick up on that and allow you to push faces out for further operations. When a primitive has this attribute, tools essentially treat them similar to fracture pieces. Remember to set the mode of the Attribute Wrangle to Run Over Primitives.


s@name = sprintf("detect_me_%d",@primnum);

Untitled-2.jpg

ap_exploded_view.hipnc

Thanks Atom !!!  But actually that is not what i mean .  what i really want is to  fractured a sphere into perfect tetrahedrons  .  Which has four faces that are equilateral triangles  .  i made a example as shown below (Not correct.  i want them to perfect and orderly consist s sphere from the inside out . )  is that possible ?

Sphere.JPG

Share this post


Link to post
Share on other sites
On 2016/6/18 at 0:23 AM, Skybar said:

Example?

 i want them to perfect and orderly consist s sphere from the inside out .  is that possible ?

Sphere.JPG

Share this post


Link to post
Share on other sites

You could try the Tetrahedralize SOP, and then convert that back to polygons or something.

Share this post


Link to post
Share on other sites

Couple questions for ya

Can you control the surface topology as in are you creating the sphere or does it come from somewhere else and its just topology you have to convert?

Second ones a little trickier but doable. Best if you can create your own sphere.

Second is the sphere either a deforming or a static mesh that gets moved?

Share this post


Link to post
Share on other sites
On 2016/6/29 at 1:50 AM, BRZ32 said:

Couple questions for ya

Can you control the surface topology as in are you creating the sphere or does it come from somewhere else and its just topology you have to convert?

Second ones a little trickier but doable. Best if you can create your own sphere.

Second is the sphere either a deforming or a static mesh that gets moved?

Thank you for ur question . and i just wanna fractured a sphere .  i don't get it from somewhere .i make my own sphere.  and i intend to do a rigidbody simulation. Get the fractured pieces is just a start . 

Share this post


Link to post
Share on other sites

If you're creating the sphere. You can just make sure its a poly sphere made of tris first. Then use a for loop to grab each primitive and extrude it in a local space to 0,0,0 based on the radius. Pack each one inside the loop and you'll have a bunch of little tetrahedrons. I mean its crude haha but I think this is what you're after.

 

 

tetras.hipnc

  • Like 1

Share this post


Link to post
Share on other sites

Create a polygon Sphere (the one with triangles). Facet the sphere with unique points to get separate triangles, 

then use the measure tool to calculate the perimeter of each triangle and then divide this value by 4 to use it as distance attribute in polyextrude node...

The only problem is that your sphere get a facet look ...

tetrahedronsSphere.hiplc

Edited by nbyte
  • Like 1

Share this post


Link to post
Share on other sites

This setup freaks me out a bit, there's just no way a normal brain figured it out like that. What the hell is wrong with you, F1? :D

Edited by Farmfield
  • Like 4

Share this post


Link to post
Share on other sites
On 2016/7/2 at 8:14 PM, nbyte said:

Create a polygon Sphere (the one with triangles). Facet the sphere with unique points to get separate triangles, 

then use the measure tool to calculate the perimeter of each triangle and then divide this value by 4 to use it as distance attribute in polyextrude node...

The only problem is that your sphere get a facet look ...

tetrahedronsSphere.hiplc

I really appreciate your help . But i think ' f1480187 '  is doing what i after . Thank u !!!:D

Share this post


Link to post
Share on other sites
4 hours ago, jingyisw said:

how did you do that? 

FFS, don't ask that, what if he tries to explain it? He'll confuse us so much, we'll all have to reboot. :D

{
    float perimeter = prim("../sphere1", 0, "intrinsic:measuredperimeter", 0);
    float side = perimeter / 3;
    float height = side * (sqrt(6) / 3);
    float layernum = detail("../replicate_spheres_metadata", "iteration", 0) + 1;
    float radius = ch("../sphere1/radx") - (side * layernum);
    return radius;
}

I was blown away by this - oh, and that you can use an expression like that in a value field, that's insane in itself...

Edited by Farmfield
  • Like 1

Share this post


Link to post
Share on other sites
On 7/2/2016 at 6:35 PM, f1480187 said:

tetrahedra_sphere.pngtetrahedra_sphere_side.pngtetrahedra_sphere_piece.png

That's how you do it.

 

tetrahedra_sphere.hipnc

This looks very interesting but the file do not work on my houdini....using 15.5.480 T_T

 

It seems that the tetrahedralize node is failing in all components....

Edited by Butachan

Share this post


Link to post
Share on other sites

@Farmfield, it's like custom function, but without first line. Maybe every expression (both Python and HScript Expression) is turned into auto-named functions. Multi-lined ones require explicit return, single-lined just automatically prepended with it.

@jingyisw, the idea is to fill sphere with smaller frequency spheres. This steps naturally create volumetric structure of tetrahedra, found by trial end error. Math research is merely a googled formula for regular tetrahedra height. In fact, I didn't even used it! Uploaded the fixed version. Now it works even better. We fill sphere with non regular ones, but they are same enough to allow everything to work.

@Butachan, intrinsics access from Expression functions available from 515 build:

prim("../sphere1", 0, "intrinsic:measuredperimeter", 0)

From The Morning Changelog:

Quote

The prim, prims, detail, and details HScript functions now support reading primitive or detail intrinsics by specifying "intrinsic:name_of_intrinsic".

Download the file again, I fixed it and also got rid of bleeding edge build dependency.

Edited by f1480187

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

×