Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Finding the center of a face

Is there a way to find the center of a face? Even though that face might have some subtractions in it and whatnot.

6 REPLIES

Re: Finding the center of a face

Yes.  You might have to extract a sheet body from the face temporarily.  And are you looking for the geographic center of the face, which ignores the holes in it, or do you want the center of mass - the point on which you could balance it, so to speak?

Re: Finding the center of a face

The second part. Center of mass including holes to find the balance

Re: Finding the center of a face

 

We can do that with UF_MODL_ask_mass_props_3d, which is also wrapped for use in .Net.

 

Do you have a preferred language?  I'll try to find an example.

 

Re: Finding the center of a face

C# would be preferable
Solution
Solution
Accepted by topic author InternBL
‎03-31-2016 03:30 PM

Re: Finding the center of a face

Here is a basic example in C#.  A couple of things to note - you might want to use different units, and you can do that by changing which massUnit assignment is uncommented.

 

Also, this function is a bit peculiar in that it returns the output info relative to the WCS, rather than the Absoluted CSYS, like almost all other NXOpen calls.  I will probably add a few lines to do that, and then I'll post it to our online samples in a day or two.

Re: Finding the center of a face

Thanks Steve. That worked really well