Does there exist in any preferably free extension something like “subdivide edges” or “divide edges”? Thanks.

With the built-in tools you can select an edge, right-click, and choose Divide. You type the number of segments you want and press Enter.

If you don’t see a Divide option, try Explode Curve first.

What is the reason you want to subdivide?

Divide from the context-menu will split a selected edge into the specified number of pieces.

The API has the: Class: Sketchup::Edge — SketchUp Ruby API Documentation

But you need to do a bit of iterating and length calculating to go beyond splitting an edge the once.

If you mean splitting a curve then Fredo’s BezierSpline tools contains something…

Right, thanks. That is what I would like, but how about multiple selected edges? (I should have added this initially.)

As part of another extension idea I am playing with - just wanted to save some time if something was available.

Do you want to split them in fixed lengths like 6" or in fractions like 1/4 of the original length ?

You need a dialog to get this either way ?

To process multiple selected edges you just iterate the:

`model.selection.grep(Sketchup::Edge){|e| #do the splitting }`

If it’s a fixed length (`d`

) you have the `len=e.length`

and can work out the split as `n=(len-d)/d`

`e.split(n)`

Now `e`

is shorter by `d`

, so reset `len=e.length`

and repeat…

The loop for repeating could be `until e.length <= d ;# do splitting; end`

Or work out how many `d`

long pieces can be split out of the original `e.length`

and iterate that number of times - 1 ?

Yes it turned out to be trivial - thanks for the hints.

Have a look at Fredos BezierSpline…

This topic was automatically closed after 91 days. New replies are no longer allowed.