Previously I’ve needed to offset a polygon which I’ve been able to do with some assistance from TIG.
Now I’m trying to figure out how to offset a locus of points/edges for a polyline (in the X and Y directions only, the points are always in the Z plane), given the edges and the amount to offset.
I don’t think any methods exist in the API for doing this sort of thing so it’s going to have to be something from scratch.
If you have any hints or ideas please feel free to post. I will provide my progression of the algorithm development as I work my way through this.
@john_mcclenahan don’t confuse the GUI Offset Tool with the SketchUp Ruby API Array#offset method. The latter is really an extension of Ruby’s Array so that an Array of three coordinates can be treated as a point/position without explicitly converting it to a Point3d. It offsets a single point by a vector to create an Array of the coordinates of a new point.
@medeek I can’t tell you an algorithm, but if you look at the history of bugs and quirks of the GUI Offset Tool you will come to realize that this problem is a lot more subtle than it might at first seem. There are a lot of funky corner cases that have to be handled. Especially for curves, there is a design issue of whether you want to offset parallel to the segments of the curve or along the local radius of the curve at each vertex.