Lee Mac 发表于 2022-7-6 07:09:57

 
Renderman, note that the center of the bounding box will rarely be equal to the centroid.

Tharwat 发表于 2022-7-6 07:13:21

 
Cheers buddy .
 
 
Very interesting indeed .

asos2000 发表于 2022-7-6 07:15:23

3 Types of output
 
attached dwg and csv files
TST.zip

Lee Mac 发表于 2022-7-6 07:17:50

 
Be careful of LType Gen

BlackBox 发表于 2022-7-6 07:21:23

 
I was just testing that, and confirmed that both the BoundingBox for a rectangle, and an identical region are the same. However, a region in an irregular "L" shape also yields a centroid that is not equal to the inside center of the polyline on which the region is based either.
 
If memory serves, this is a topic we discussed in the past, and while I grant you that the region centroid is better, it's still lacking the true centroid of the polyline. This even holds true with Gile's OSNAP plug-in (i.e., 'CTR) unfortunately.

Lee Mac 发表于 2022-7-6 07:25:45

 
The rectangular (including square) case will be one of the few cases for which they are equal, since the bounding box will obviously be equal to the polyline. Other cases of equality would be where the shape is symmetrical, however in real-world applications, I'm sure that you will agree that such polylines will rarely be entirely rectangular or symmetrical.
 
 
What is the 'true centroid'?

Lee Mac 发表于 2022-7-6 07:27:49

 
Note that this filter will allow the user to select open polylines with LType Gen on, and polyline meshes.

BlackBox 发表于 2022-7-6 07:30:54

 
100% agree.
 
 
The absolute center of any
[*]Polyline (within the entity), and not simply the half-sum of all of it's vertices which commonly resides outside of an entity (obviously varying by shape).

BlackBox 发表于 2022-7-6 07:35:18

 
Always happy to not help
 
Actually, I appreciate the point being clarified, as we only use dashed line types for existing features which are typically open. In any event, this may only be limited to our purposes, and others may suspect me of being the worst LISP coder ever.

Lee Mac 发表于 2022-7-6 07:38:16

 
But the centroid isn't the "half-sum of all of it's vertices" - this will only yield the same result for regular polygons; here is how I calculate the centroid for a polygon - but again, this will lie outside for some polygons (L-shapes for example), but to my knowledge this is a property of the centroid definition.
页: 1 [2]
查看完整版本: Handle and Centre Co-ordinate