Asking For Help Points are not planar (resolved)
-
i am trying to read polyline from xml document,then to generate three-dimensional wall.now there is a problem that just lines in the X direction can be drawn,the others in the y direction can not be drawn,and show a message that
Error: #<ArgumentError: E:\test\RubyApplication1\lib\main.rb:250:in `add_face': Points are not planar>// if i draw the lines in the y -direction by it self,it can be done, i dont know why?pelese help me!
thank u very much![code][code][code][/code][/code][/code]
[attachment=1:3jpuek0d]<!-- ia1 -->main.rar<!-- ia1 -->[/attachment:3jpuek0d]
-
Would help if you enclosed your code in the CODE tag so it doesn't get smileys in the code - and it will preserve formatting. And with such a long code it's probably easier to just attach it.
-
@thomthom said:
Would help if you enclosed your code in the CODE tag so it doesn't get smileys in the code - and it will preserve formatting. And with such a long code it's probably easier to just attach it.
ok,i have done.thank u
-
Have you outputted the loopVertices to the Ruby Console content before passing on add_face? Just to visually inspect the data?
Have to look further into what the code does before I can say anything more.
But this code, right before line 250.
loopVertices = [] for v in loop loopVertices.push([v.x,v.y,v.z]) end
Should that not say
for v in loop.vertices
?I gather that you want an array of 3D points?
That can be written:
loopVertices = loop.vertices.collect { |v| v.position }
Vertex.position
returns aPoint3D
for thatVertex
. -
@thomthom said:
Have you outputted the loopVertices to the Ruby Console content before passing on add_face? Just to visually inspect the data?
Have to look further into what the code does before I can say anything more.
But this code, right before line 250.
> loopVertices = [] > for v in loop > loopVertices.push([v.x,v.y,v.z]) > end >
Should that not say
for v in loop.vertices
?I gather that you want an array of 3D points?
That can be written:
> loopVertices = loop.vertices.collect { |v| v.position } >
yes ,i have inspected all the loopvertices to the Ruby Console content,every wall has 6 faces.
but if passing on add_face,the error will come out with the message points are not planar.
Vertex.position
returns aPoint3D
for thatVertex
. -
I think I got that error sometime when I had only 3 points. I thought there must be some mistake as any 3 points are planar. I found out later that the 3 points were in fact linear, and thus not planar.
Maye this is what is happening?
pts = [ [0, 0, 0], [1, 0, 0], [2, 0, 0] ] Sketchup.active_model.entities.add_face pts Error; #<ArgumentError; (eval);65;in `add_face'; Points are not planar>
-
i have solved the problem ,thank u
-
-
Advertisement