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::Transformation
instance, 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::Transformation
instance, 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::Vector3d
argument ? -
For simple objects you can move them without grouping.
Assume
c
is 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
Advertisement