Model.morphshapecreateorthogonalbound#
- Model.morphshapecreateorthogonalbound(s_collection, md_collection, system_entity, method, prec, tol, initial, l_bound, u_bound)#
Converts all the shapes on the first collection into shapes, design variables, equations, and dlink2 entities when using the constraint and system methods. An initial value along with upper and lower bounds can be set for the design variables.
For the constraint method, a non-linear shape will be deduced by applying each shape on the
s_collectionby 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_collectionis applied, and ending at the position attained when the shape on thes_collectionis applied.For the system method, each shape on
s_collectionwill 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 options in the argument
method, 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 the argument
method, 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.
initial (double) – The initial value of the design variables.
l_bound (double) – The lower bound of the design variables.
u_bound (double) – The upper bound of the design variables.
Examples#
Create non-linear shapes, equations, etc., for all the shapes in the model use the constraint method, with 0.5 as the initial value, and lower and upper bounds of 0.0 and 1.0#import hm import hm.entities as ent shape_collection = hm.Collection(model, ent.Shape) model.morphshapecreateorthogonalbound( s_collection=shape_collection, md_collection=shape_collection, system_entity=None, method=0, prec=10, tol=0.001, initial=0.5, u_bound=0.0, l_bound=1.0, )
Create non-linear shapes, equations, etc., for the shape with name “full” use the shape with name “mid” as the mid-shape , with 0.5 as the initial value, and lower and upper bounds of 0.0 and 1.0#import hm import hm.entities as ent model = hm.Model() model.morphshapecreateorthogonalbound( 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, initial=0.5, u_bound=0.0, l_bound=1.0, )