Face between two arc curve
-
I am looking for a way to create a face between two arc curve.
` model = Sketchup.active_model
entities = model.entities
group = entities.add_group
entities = group.entitiesHalbkreis nach rechts / half curve to right
center = Geom::Point3d.new 150.mm,0,0
normal = Geom::Vector3d.new 0,0,1
xaxis = Geom::Vector3d.new 1,0,0
start_a = Math::PI/-2
end_a = Math::PI/2
edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a
edge = edgearray[0]
arccurve = edge.curveHalbkreis nach links / half curve to left
center = Geom::Point3d.new 50.mm,0,0
normal = Geom::Vector3d.new 0,0,1
xaxis = Geom::Vector3d.new 0,1,0
start_a = 0.0
end_a = Math::PI
edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a
edge = edgearray[0]
arccurve = edge.curveface = entities.add_face arccurve
status = face.pushpull 20.mm`Thank for help.
-
Use
arccurve1
and thenarccurve2
for the two curves...
then combine them
face=entities.add_face(arccurve1+arccurve2)
???
OR
arccurve[0].find_faces
BUT there's no automatic references to the new face
although it is still get-able... -
hermann, The problem is that if you use edges or curves to add a face, they must form a closed figure which yours doesn't. What you need to do is extract and use the vertices of the two arcs to define the face. So after the first arc, add verts=arccurve.vertices. After the second arc, add verts+=arccurve.vertices. The add_face statement would then be face=entities.add_face verts.
model = Sketchup.active_model entities = model.entities group = entities.add_group entities = group.entities # Halbkreis nach rechts / half curve to right center = Geom;;Point3d.new 150.mm,0,0 normal = Geom;;Vector3d.new 0,0,1 xaxis = Geom;;Vector3d.new 1,0,0 start_a = Math;;PI/-2 end_a = Math;;PI/2 edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a edge = edgearray[0] arccurve = edge.curve verts = arccurve.vertices # Halbkreis nach links / half curve to left center = Geom;;Point3d.new 50.mm,0,0 normal = Geom;;Vector3d.new 0,0,1 xaxis = Geom;;Vector3d.new 0,1,0 start_a = 0.0 end_a = Math;;PI edgearray = entities.add_arc center, xaxis, normal, 50.mm, start_a, end_a edge = edgearray[0] arccurve = edge.curve verts += arccurve.vertices face = entities.add_face verts status = face.pushpull 20.mm
Advertisement