Jump to content

How to perfect fractured a sphere into tetrahedrons ?


jingyisw

Recommended Posts

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
Link to comment
Share on other sites

  • 2 weeks later...
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

Link to comment
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?

Link to comment
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 . 

Link to comment
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
Link to comment
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
Link to comment
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

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...