Move point?
-
(newb question here)
With "ComponentInstance" and "tranformation" you can move a selected component around.
Is there a way to move a selected point around? Or does it get complicated by having to select an edge, then find the points in it to move?
-
You can move Instances/Groups, Points and Vertices.
You apply transformations to most but for vertices you must use another method
'Transformations' can be points, translations, rotations and scaling etc...tr=Geom::Transformation.translation([0,0,1])
### =='changes' something; here == move it up 1 unit...
group.transform!(tr)
### =='changes' the group by 'tr', up 1 unit...
or
point.transform!(tr)
### =='changes' point by 'tr', up 1 unit...but for a vertex or vertices you need to use...
entities.transform_entities(tr,[vertices])
here an array (list) of vertices have 'tr' applied...
or
entities.transform_by_vectors([vertices],[vectors])
you take an array of vertices and apply an array of vectors to do the translation...
So for one vertex
entities.transform_by_vectors([vertex],[[0,0,1]])
### moves vertex by vector up 1 unit in Z...You can also apply these 'entities.transform....' methods to any collection of 'things' like an array of group.entities...
-
Very cool! Thanks for the examples, TIG!
The difference between 'point' and 'vertex' is construction point vs. edge point?
-
ConstructionPoint
is a construciton pointEntity
.
Vertex
is the end points of Edges.Point3d
is just a point in 3d space. -
...and
vertex.position
returns the point in space that the vertex is -
Awesome -- all very helpful bits of info!
Advertisement