How to explode a curve face

How to explode a one curve face into separate planar faces using Ruby API?

How to convert this:


into:

SKP: test1.skp (127.1 KB)

Curves don’t exist as such in SketchUp, they are always series of straight edges. The difference between your two images is just whether or not the soft/smooth edges are visible.

There is one more difference: I can’t select one separate face on the first image

@slbaumgartner is there any way to switch from the first image into the second using Ruby API?

thanks!

Gather the edges and turn off their soft and smooth properties.

1 Like

@slbaumgartner thanks! It works

Sketchup.active_model.entities.grep(Sketchup::Edge).each do |edge|
  edge.soft = false
  edge.smooth = false
end
1 Like

And if it was selected …

Sketchup.active_model.selection.grep(Sketchup::Edge).each do |edge|
  edge.soft = false
  edge.smooth = false
end

You CAN select single faces if you switch View > Hidden Geometry ON.
Then you do not need to unsoften/unsmooth the edges.