Get centerpoint or Center of mass

Started by swebjorn, October 10, 2021, 11:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

swebjorn

Hi,
I am developing functions for Mastercam with Mastercam SDK.

What I am looking for is the marked area in the picture below. I want to get the center of mass programaticaly with C# and the SDK.

Below is in swedish, but it is the center of mass I am after. Is there a command or function to get it? I have been able to get all points out of a 2D shape. But now I want the center of the shape.

If someone has the answer I would be very happy!

https://images.solarplexius.se/images/site/Get_center_of_mass.jpg">

byte

#1
Quote from: swebjorn post_id=16952 time=1633933496 user_id=220Hi,
I am developing functions for Mastercam with Mastercam SDK.

What I am looking for is the marked area in the picture below. I want to get the center of mass programaticaly with C# and the SDK.

Below is in swedish, but it is the center of mass I am after. Is there a command or function to get it? I have been able to get all points out of a 2D shape. But now I want the center of the shape.

If someone has the answer I would be very happy!

https://images.solarplexius.se/images/site/Get_center_of_mass.jpg">


Good day,

to get the center of gravity of a group of wireframe I usually use the creep_record function from the chook sdk,

What version of Mastercam are you using?

swebjorn

#2
I am using Mastercam 2022 and NET-Hook Api.

Did not find creep_record in net-hook reference, perhaps a different name there.

byte

#3
creep_record is part of the chook sdk in c++, the nethook api is not able to read the points from wireframe the way you want.

The sdk downloads are available here

https://my.mastercam.com/communities/3rd-party-developers/sdk-downloads/">https://my.mastercam.com/communities/3r ... downloads/">https://my.mastercam.com/communities/3rd-party-developers/sdk-downloads/