Offset-function per ruby (simple)
-
hi,
is there an equivalent for the skp-function "offset" in ruby for simple forms like square or circle ?
thanx stan -
If you group the objects it makes things much simplier:
g.move! [1,1,0]Moves the group by the vector array argument. (The API dictionary says the arg should be a
Geom::Transformationinstance, but the method also takes an array representing a vector.) Does NOT add the move to the Undo stack.g.transform! [1,1,0]Moves the group by the vector array argument. (The API dictionary says the arg should be a
Geom::Transformationinstance, but the method also takes an array representing a vector.) ADDS the move to the Undo stack as "Move".I would assume that these methods may also accept a
Geom::Vector3dargument ?
-
For simple objects you can move them without grouping.
Assume
cis the reference to a circle object.c.parent.entities.transform_entities( [1,1,0], c )
Or for an array
[e1,e2,e3,e4]of edges making up a square:e1.parent.entities.transform_entities( [1,1,0], [e1,e2,e3,e4] )
- The above methods add to the undo stack.
Also be aware strange results may happen if the entities to be moved are not in the current editing context.

-
@artmusicstudio said:
hi,
is there an equivalent for the skp-function "offset" in ruby for simple forms like square or circle ?
thanx stanWere you looking to move objects, per Dan's replies, or for a Ruby equivalent to the offset tool (i.e. to create a "parallel" shape inside or outside the original)?
-
@slbaumgartner said:
@artmusicstudio said:
hi,
is there an equivalent for the skp-function "offset" in ruby for simple forms like square or circle ?
thanx stanWere you looking to move objects, per Dan's replies, or for a Ruby equivalent to the offset tool (i.e. to create a "parallel" shape inside or outside the original)?
hi, slbaumgartner,
yes , you got it,
what i look for here (though dan's advice is also helpful for other things)
is in deed the offset-function, creating a parallel shape (only simple forms like rectangles or circles).stan
-
@artmusicstudio said:
@slbaumgartner said:
@artmusicstudio said:
hi,
is there an equivalent for the skp-function "offset" in ruby for simple forms like square or circle ?
thanx stanWere you looking to move objects, per Dan's replies, or for a Ruby equivalent to the offset tool (i.e. to create a "parallel" shape inside or outside the original)?
hi, slbaumgartner,
yes , you got it,
what i look for here (though dan's advice is also helpful for other things)
is in deed the offset-function, creating a parallel shape (only simple forms like rectangles or circles).stan
you can try this:
http://www.smustard.com/script/Offset
simply works for faces(polygons) and polylines
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement