Edge.split Point3d not working as expected?
-
Hi, this is the code I'm testing
edge = Sketchup.active_model.entities.add_line([0,10,0],[100,10,0])
pt = Geom::Point3d.new ([80,200,100])
result = edge.split ptI was under the impression that if the supplied Point3d was not on the edge, then the edge would not be split and it would return an error. But no matter I put in for the Point3d in this example, it always breaks the line. Well, thats not true, as long as the x value is less than 100. Anyhow, is this method slightly broken?
Chris
-
Look at my "AddVertex+.rb" that let's you add cpoints and split edges faces etc in a number of ways depending on which modification-keys you hold down as you pick the point. It checks whether you are picking on an edge, face etc...
-
Well its not that I can't get it to work, its that I think it is flawed, or else I'm misunderstanding how the method is supposed to work.
The API says that you can give .split accepts a Point3d onject or a float. If its a float, zero through 1, then it uses that to splut the edge using the float as a sort of percentage. That works great.
It says that if you supply a Point3d object, it MUST be on the edge.
But the example I showed, the point3d object is not on the edge at all, but it still split the edge. So it seems like it should return an error or false or something. But its not, it splitting the edge. Which is wrong.
Or am I just misunderstanding the method?
Chris
-
It does sound like it should fail if it's not on the edge. I would have expected a nil return like many of the other functions when they fail.
Advertisement