简体   繁体   English

当 angle.Value() 改变时如何更新交叉点

[英]How update intersection when an angle.Value() change

I have a construction that starts with a point and a segment.我有一个以点和线段开始的结构。 Later I have an intersection.后来我有一个路口。 The correct output of the intersection depend if the 3.rd parameter i is 0 or 1. The point and the line are not part of create('intersection'.... If 0 or 1 depends where the point is relative to the line. Is it above or left the line it is 1 otherwise 0. So I thougt I create an angle between the the point and the segment and decide if the angle is less pi. Statically this works, but how do I update the intersection, if I move the point or the segment?交叉点的正确 output 取决于 3.rd 参数 i 是 0 还是 1。点和线不是 create('intersection'... 的一部分。如果 0 或 1 取决于点相对于线的位置.它是在线的上方还是在线的左侧,否则为 1,否则为 0。所以我想我在点和线段之间创建一个角度,并确定该角度是否小于 pi。从静态上讲,这是有效的,但是如果我如何更新交点,如果我移动的是点还是线段?

Best regards basil最好的问候罗勒

At the moment (ie v1.5.0) dynamic values for the intersection number are not supported.目前(即 v1.5.0)不支持路口编号的动态值。 But this is a very good suggestion.但这是一个非常好的建议。 We included it into the source, it will be available in 1.5.1.我们将它包含在源代码中,它将在 1.5.1 中可用。 Here is an example how to use it:这是一个如何使用它的例子:

var ci = board.create('circle', [[0, 0], 3]);
var li = board.create('line', [[-3, -3], [4, 1]]);

var sl = board.create('slider', [[1,4], [2,4], [0, 0, 1]], 
            {snapWidth: 1, name:'i', digits:0});
var is = board.create('intersection', [ci, li, () => sl.Value()]);

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

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