乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: ClareSelley

[编程交流] Handle and Centre Co-ordinate

[复制链接]

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:09:57 | 显示全部楼层
 
Renderman, note that the center of the bounding box will rarely be equal to the centroid.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 07:13:21 | 显示全部楼层
 
Cheers buddy .
 
 
Very interesting indeed .
回复

使用道具 举报

51

主题

481

帖子

457

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
262
发表于 2022-7-6 07:15:23 | 显示全部楼层
3 Types of output
 
attached dwg and csv files
TST.zip
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:17:50 | 显示全部楼层
 
Be careful of LType Gen
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 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.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 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'?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 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.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 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).
  • 回复

    使用道具 举报

    44

    主题

    3166

    帖子

    2803

    银币

    中流砥柱

    Rank: 25

    铜币
    557
    发表于 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.
    回复

    使用道具 举报

    114

    主题

    1万

    帖子

    1万

    银币

    中流砥柱

    Rank: 25

    铜币
    543
    发表于 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.
    回复

    使用道具 举报

    发表回复

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    • 微信公众平台

    • 扫描访问手机版

    • 点击图片下载手机App

    QQ|关于我们|小黑屋|乐筑天下 繁体中文

    GMT+8, 2025-3-10 18:33 , Processed in 1.118613 second(s), 81 queries .

    © 2020-2025 乐筑天下

    联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表