Model.geomvectorupdate#

Model.geomvectorupdate(vector_collection, geom_collection, node_tol, magnitude, parlen, reverse, update_geom, update_mag, update_reverse)#

Updates input vectors in such a way that vector direction coincides with line tangent or surface normal at closest to the node point on geometry.

Parameters:
  • vector_collection (Collection) – The collection containing the vector entities to update used to set vectors direction.

  • 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_tol (double) –

    If positive, then used as proximity tolerance for geometry points. This means that vector is not updated 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 updated vector (except for the case when parameter parlen is not zero).

  • parlen (int) –

    Parameter that specifies the method to calculate resulted vector length. Valid values are:

    0 - The value specified by magnitude parameter 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.

  • update_geom (int) – A flag (0 or 1) to update vectors direction. If set to 1, then input geometry is used to update vectors direction.

  • update_mag (int) – A flag (0 or 1) to update vectors magnitude. If set to 1, then vectors magnitude is updated. The flag is ignored, if update_geom flag is set.

  • update_reverse (int) – A flag (0 or 1) to update vectors magnitude. If set to 1, then vectors magnitude is updated. The flag is ignored, if update_geom flag is set.

Example#

Update vector with ID 10 to have direction tangent to curve with ID 4 at point closest to vector base node#
import hm
import hm.entities as ent

model = hm.Model()

model.geomvectorupdate(
vector_collection=hm.Collection(model, ent.Vector, [10]),
geom_collection=hm.Collection(model, ent.Curve, [4]),
node_tol=-1.0,
magnitude=1.0,
parlen=0,
reverse=0,
update_geom=1,
update_mag=0,
update_reverse=0,
)