繁体   English   中英

使用圆半径查找坐标以创建形状

[英]Find coordinates using circle radius to create shapes

我使用脚本来创建形状,通常可以使用图像贴图来绘制坐标,但是此脚本使用的是圆半径的坐标。

是否有工具可以从圆半径绘制坐标,或者有更好的坐标绘制方法,例如:

这是用于多边形/星形形状,很难使形状对称。 我将制作其他更复杂的形状

circles.push(new Circle(width / 2 - 70, height / 2 - 120, circleRadius));
circles.push(new Circle(width / 2 - 0, height / 2 - 250, circleRadius));
circles.push(new Circle(width / 2 + 70, height / 2 - 120, circleRadius));
circles.push(new Circle(width / 2 + 220, height / 2 - 120, circleRadius));
circles.push(new Circle(width / 2 + 120, height / 2 - 0, circleRadius));
circles.push(new Circle(width / 2 + 180, height / 2 + 180, circleRadius));
circles.push(new Circle(width / 2 - 0, height / 2 + 120, circleRadius));
circles.push(new Circle(width / 2 - 180, height / 2 + 180, circleRadius));
circles.push(new Circle(width / 2 - 120, height / 2 - 0, circleRadius));
circles.push(new Circle(width / 2 - 220, height / 2 - 120, circleRadius));

您为什么不尝试使用与所需形状相同的背景图像,这将帮助您准确获得所需形状。

对于您所说的多边形,请尝试使用这些坐标,这将为您提供更好的形状。

circles.push(new Circle(width / 2 - 60, height / 2 - 60, circleRadius));
circles.push(new Circle(width / 2 - 0, height / 2 - 250, circleRadius));
circles.push(new Circle(width / 2 + 60, height / 2 - 60, circleRadius));
circles.push(new Circle(width / 2 + 260, height / 2 - 60, circleRadius));
circles.push(new Circle(width / 2 + 100, height / 2 + 60, circleRadius));
circles.push(new Circle(width / 2 + 160, height / 2 + 250, circleRadius));
circles.push(new Circle(width / 2 - 0, height / 2 + 130, circleRadius));
circles.push(new Circle(width / 2 - 160, height / 2 + 250, circleRadius));
circles.push(new Circle(width / 2 - 100, height / 2 + 60, circleRadius));
circles.push(new Circle(width / 2 - 260, height / 2 - 60, circleRadius));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM