Model.morphshapecreateorthogonal#

Model.morphshapecreateorthogonal(s_collection, md_collection, system_entity, method, prec, tol)#

Converts all the shapes on the first collection into shapes, design variables, equations, and dlink2 entities when using the constraint and the argument method. For the mid-shape v, only one shape may be converted at a time and each collection should contain one and only one unique shape.

For the constraint method, a non-linear shape will be deduced by applying each shape on the s_collection by a number of factors from 0.0 to 1.0 equal to the value of prec, enforcing any active constraints, and fitting a curve through the intermediate positions for each node.

For the mid-shape method, a non-linear shape will be deduced by fitting a shape through a curve beginning at the unperturbed position, traveling through the position attained when the shape on the md_collection is applied, and ending at the position attained when the shape on the s_collection is applied.

For the system method, each shape on s_collection will be assumed to rotate about the z-axis of the selected system instead of moving linearly in the xy plane. A non-linear shape will be deduced from the circular node paths.

For all methods, the non-linear paths of the nodes are represented by a pair of linear shape variables, plus a corrective shape variable, which are linked together via equations and dlink2 entities. The result is a single design variable which, when changed, applies the linear shape variables in such a way that the nodes move along non-linear paths.

For the constraint and system methods, if multiple shapes are selected, conflicts between each pair of shapes (such as when the application of one shape causes another to violate constraints) are detected and resolved by adding a corrective shape which is linked to those two shapes through an equation and a dlink2 entity.

Parameters:
  • s_collection (Collection) – The collection containing the input shape entities.

  • md_collection (Collection) – The collection containing the mid_shape entities (if method=1).

  • system_entity (Entity) – The object describing the entity (if method=2).

  • method (int) –

    0 - non-linearity is due to constraints

    1 - non-linearity is deduced from mid-shape

    2 - non-linearity is due to rotation about a system

  • prec (int) – Number of intermediate positions for non-linear approximation.

  • tol (double) – Tolerance for establishing linear versus non-linear.

Examples#

Create non-linear shapes, equations, etc., for all the shapes in the model use the constraint method#
import hm
import hm.entities as ent

model = hm.Model()

shape_collection = hm.Collection(model, ent.Shape)

model.morphshapecreateorthogonal(
    s_collection=shape_collection,
    md_collection=shape_collection,
    system_entity=None,
    method=0,
    prec=10,
    tol=0.001,
)
Create non-linear shapes, equations, etc., for the shape with name “full” use the shape with name “mid” as the mid-shape#
import hm
import hm.entities as ent

model = hm.Model()

model.morphshapecreateorthogonal(
    s_collection=hm.Collection(model, ent.Shape, "name=full"),
    md_collection=hm.Collection(model, ent.Shape, "name=mid"),
    system_entity=None,
    method=1,
    prec=10,
    tol=0.001,
)