CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoLISP 开发指南

应用一些逻辑

2023-1-5 07:18| 发布者: admin| 查看: 258| 评论: 0|来自: AutoCAD

您需要做的一件事是确定如何间隔瓷砖并绘制它们。如果这是一个简单的直线图块网格,则可以使用 ARRAY 命令填充图块。但是对于花园路径,您需要使每行瓷砖与前一行偏移。

此行偏移模式是重复模式。想想如果你正在建造实际的路径,你可能会如何铺设瓷砖。您可能会倾向于从一端开始,然后继续放置行,直到没有更多的空间。

下面是伪代码中的逻辑:

At the starting point of the path
Figure out the initial row offset from center (either centered on
the path or offset by one "tile space").
While the space of the boundary filled is less than the space to
fill,
  Draw a row of tiles.
  Reset the next start point (incremented by one "tile space").
  Add the distance filled by the new row to the amount of space
  filled.
  Toggle the offset (if it is centered, set it up off-center, or
  vice versa).
  Go back to the start of the loop.

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 13:17

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部