Strictly speaking, I'm not a new member, as my first (and, until now, only) post was 5 years ago. But my second and third posts have been sitting in moderation for 24 hours now... I'm not that easily mistaken for spam, am I?
Posts
-
RE: A Welcome Message to New SketchUcation Members
-
RE: Random move components?
@eram said:
does anybody know how to randomly rotate elements in a similar way ?
Rotation requires a point, a vector, and an angle. The point + vector tells us the axis of rotation. Do you want to rotate objects around the origin? Around their "center"? (Which center? Orthocenter? Center of gravity? Something else?) Do you want to rotate just around the Z axis (like spinning a top) or some other random axis (like rolling a bowling ball with side spin)?
This will get you rotation around the Z access at the origin by a random angle:
Sketchup.active_model.selection.each do |block| block.transform!(Geom::Transformation.rotation(Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0,0,1), rand(2*Math::PI))) end
-
RE: Engraved sign maker, technique, or plugin
Back to the original question of how to engrave text: if you have the Pro version, the solid tools make combining the 3D Text component and the rest of the model easy.
For the rest of us, a few lines of Ruby make it easier to select all those faces and fill in the missing holes. See http://www.instructables.com/id/Engrave-3D-Text-With-Sketchup/
-
RE: Random move components?
I needed something similar, so I threw together this one-liner. First ruby code I've ever written, so I'm sure it's possible to make it more elegant.
Sketchup.active_model.selection.each do |block| block.transform!(Geom;;Transformation.translation(Geom;;Vector3d.new(0,0,3*rand(6)))) end
As written, it takes each component in the selection, and moves it a random multiple of 3 between 0 and 18 along the Z axis.