PDA

View Full Version : DPKit: determing the centroid of a 'Part' ?

jeric_synergy
10-02-2015, 01:54 PM
How does one determine the 'centroid', if I'm using that correctly, of a DPKit-style 'part'?

MonroePoteet
10-04-2015, 10:09 AM
From a little testing, I'd guess it's the average of the point locations of the part. The attached scene rotates a "part" using DPKit Part Move, but the pivot point for the rotation is clearly NOT either the origin (modeler pivot point) or the center of the bounding box. BTW, as you probably know, you can specify the Pivot in the UI for Part Move.

mTp

jeric_synergy
10-04-2015, 10:13 AM
Monroe, indeed, you can specify it, but locating the proper numbers? That's what I'm trying to determine.

MonroePoteet
10-04-2015, 12:39 PM
Here's the Wikipedia article on the centroid:

https://en.wikipedia.org/wiki/Centroid

including the formulae to calculate the centroid of a polygon:

https://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon

which according to the introduction in the article:

The definition extends to any object in n-dimensional space: its centroid is the mean position of all the points in all of the coordinate directions.

I don't know what algorithm Denis actually uses to calculate it in Part Move, though.

mTp

jeric_synergy
10-04-2015, 01:30 PM
Yeah, that's the problem: what is the bbox of the "part".

It might be there already. Or Denis might add it if he sees this post. ;)

(Which he has done before, merci beaucoup to him.)

MonroePoteet
10-04-2015, 07:53 PM
What problem are you trying to solve? If you need access to specific details or better control on a "part", move it to a different layer and treat it as a different object. Then, you have access to its Pivot Point directly in Layout via Modify => Move Pivot Point.

mTp