Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 booard.create("polygon",[p1,p2]) 创建了一个边相等(正方形)的多边形,我想在该多边形的每个边界线上添加刻度。怎么做,我知道如果使用线和线段来创建那个形状可以做到,但我是用多边形做的,有什么想法吗?
可以通过以下方式访问多边形的边缘,borders并且可以为每个边缘创建刻度:
borders
var pol = board.create("polygon",[p1,p2]); var i, ti = []; for (i = 0; i < pol.borders.length; ++i) { ti.push(board.create('ticks', [pol.borders[i]])); }