Model.geomvectorcreate#
- Model.geomvectorcreate(geom_collection, node_collection, node_tol, magnitude, parlen, reverse)#
Creates vectors on input set of nodes in such a way that vector direction coincides with line tangent or surface normal at closest to the node point on geometry.
- Parameters:
geom_collection (Collection) – The collection containing the line or surface entities to create the line tangent or the surface normal (respectively) used for the vector direction.
node_collection (Collection) – The collection containing the node entities that will used as a base for creating vector and to find closest point on geometry to calculate vector direction.
node_tol (double) –
If positive, then use as proximity tolerance for geometry points. This means that vector is not created unless closest point of selected geometry is found within the distance specified by
node_tol.If
node_tol < 0, then allowed distance to closest point is not limited.magnitude (double) – Parameter that specifies the length of resulted vector (except for the case when parameter
parlenis not zero).parlen (int) –
Parameter that specifies the method to calculate resulted vector length. Valid values are:
0 - The value specified by magnitude parameter is used.
1 - Parametric value is used. For curve tangent this is the value of parametric curve derivative. For surface normal the value is defined by the length of cross product of surface parametric derivatives. Parameterization of curves and surfaces is normalized from 0 to 1.
reverse (int) –
Parameter that specifies direction of resulted vector. Valid values are:
0 - Direction coincides with parametric direction of curve or surface normal.
1 - Direction is opposite to parametric direction of curve of surface normal.
Example#
Create a unit vector have node with ID 1 as its base and tangent to curve with ID 4 at point closest to specified node#import hm import hm.entities as ent model = hm.Model() model.geomvectorcreate( geom_collection=hm.Collection(model, ent.Node, [1]), node_collection=hm.Collection(model, ent.Surface, [4]), node_tol=-1.0, magnitude=1.0, parlen=0, reverse=0, )