Classes namespace

Classes.Assembly module

class Classes.Assembly.Instance(ElementType=None, FirstNode=1)[source]

Bases: object

Get_NodeID()[source]

A simple method to get the current node number and automatically increment to the next number

class Classes.Assembly.Model(InstanceList=[], FirstNode=1)[source]

Bases: object

GenerateINP()[source]

Takes all the instances in the InstanceList and call their respective Generate_PartINP_String keeping track of the node numbers

Then all all their respective Generate_AssemblyINP_String

Preview()[source]

Classes.FEM module

class Classes.FEM.BeamMesh(Namestr, ElemType, Radius, TypeStr, PosStr, NodeList=[], ElemList=[], Node0=1, Elem0=1)[source]

Bases: object

InpPart()[source]
class Classes.FEM.EmbededBeam(BeamMesh, BundleR, FilR)[source]

Bases: object

Generate(Config=['Truss', 'Beam'])[source]
class Classes.FEM.LineElement(Node1, Node2, ID)[source]

Bases: object

string()[source]
class Classes.FEM.node(X, Y, Z, ID)[source]

Bases: object

string()[source]

This method is used to generate the inp instructions to generate the node in abaqus no parameter is required and the output is directly a string that can be added to an inp file

Classes.Geometry module

class Classes.Geometry.Order3Base(e1=[1, 0, 0], e2=[0, 1, 0], e3=[0, 0, 1], BuildFromThis=False)[source]

Bases: object

Used to store 3D linear algebra bases three attribues: e1, e2 and e3, corresponding to the three vectors

The vector given as entry will always be normalized

__getitem__() is defined so that you can call an axis by its index or char reference (x, y or z)

class Classes.Geometry.ParametricLine(VectorTuple, InterceptTuple)[source]

Bases: object

MakeLinearMatrix()[source]

Classes.Path module

class Classes.Path.path(Lx=[], Ly=[], Lz=[])[source]

Bases: object

Init3DHelix(theta, DirectionParam, Pitch, Nby, Dbyin, Dbyout, PlaitSegments)[source]

Credits to Louis for most of the code in this function, most of it comes from a matlab script he had written that I converted in Python

Init3DSinus(LinearMatrix, Lengh, NbPoints, Omega, Phi, R0, Cth, Th0, OffX=0, OffY=0, OffZ=0)[source]

The linear matrix parameter is defined as follow:

[[Cx,Cy,Cz],
[Ax,Ay,Az]]

Équation paramétrique de la droite {x = Cx*t+Ax;y = Cy*t+Ay;z = Cz*t+Az}

Équation du sinus: définie en coordonées cylindriques autour de x x -> x ; y -> r sin(theta) ; y -> r cos(theta) {r = R0*sin(Omega*x+Phi), theta = Cth*x+Th0}

OffX, OffY and OffZ are used to add offset to the filaments generate (between each filament in a strand for example)

InitLinear(LinearMatrix, Lengh, NbPoints, OffX=0, OffY=0, OffZ=0)[source]

Équation paramétrique de la droite {x = Cx*t+Ax;y = Cy*t+Ay;z = Cz*t+Az}

MakeNodeList(ID0=0, R=0, YarnR=0, SparsingCoeff=0)[source]

Classes.RigidBodies module

class Classes.RigidBodies.Pulley(Name, Density, ShapeString, ShapeArgs, RotInertiaMatrix=None, CenterPoint=[0, 0, 0], RotVect=[0, 0, 0], **kwargs)[source]

Bases: Classes.RigidBodies.rigid_Body

Subclass of rigid_Body, used to define pulleys.

New attributes: ShapeString –> defines the type of pulley, admissible values are “Cyl” (Cylinder), “V” (Vshape contact surface), “U” (U shape contact surface) and “I” (Cylinder with borders)

ShapeArgs –> Tuple used to specify the shape-related parameters

Draw(Sides=100, color=(0.399185979089583, 0.9018122394035573, 0.6674813312218133), standalone=True, fig=None)[source]
PolygonString()[source]
class Classes.RigidBodies.SquareSectionBar(Name, Density, ShapeArgs, RotInertiaMatrix=None, CenterPoint=[0, 0, 0], RotVect=[0, 0, 0])[source]

Bases: Classes.RigidBodies.rigid_Body

Draw(color=(0.23882865346766013, 0.842078375174666, 0.7007839070535538), standalone=True, fig=None)[source]
PolygonString()[source]
Classes.RigidBodies.random() → x in the interval [0, 1).
class Classes.RigidBodies.rigid_Body(Name, Density, RotInertiaMatrix=None, CenterPoint=[0, 0, 0], RotVect=[0, 0, 0], **kwargs)[source]

Bases: inPy.Classes.Assembly.Instance

Master class, all the other classes should herit from this one

Calc_Rotary_intertia()[source]

this function is empty here but must be redefined in subclasses

Generate_AssemblyINP_String()[source]
Generate_PartINP_String()[source]

This function returns the string to add to the inp when generating the parts

Classes.Wired_Structures module

class Classes.Wired_Structures.Braid(Pitch, Nby, Dbyin, BraidThickness, PlaitSegments, R, Config=['Beam', None], SparsingCoeff=0, Imposed_FilR=None, **kwargs)[source]

Bases: inPy.Classes.Assembly.Instance

Class used to represent a braid, mandatory parameters are Pitch, Nby (number of strands, must always be even), Dbyin (internal radius) BraidThickness (Thickness of the braid), PlaitSegments (discretization of each beam) and R (number of radiuses in each strand).

Valid optional paramters are: Config —> Array used to configure the embeded beams configuration [2x1], Config[0] gives the external elements type, Config[1] give the internal element Type For example Config = ["Truss",None] will configure inPy to only use Truss elements, Config = ["Truss","Beam"] is the default embeded beam situation with external truss and internal beams, default to [“Beam”,None]

SparsingCoeff this parameter will be changed in future version, right now, it controlls the circlespacking call and defines the gap between each filaments center the smallest distance between each filament is defined as d = (1 + Filament_Diameter)*SparsingCoeff, default to 0

Imposed_FilR allows the user to specify a filament radius, default to None and in this case, the filament radius is defined as BraidThickness/2*R

**kwargs –> used to defined the Instance master-class attributes if needed

Create_BCINP_String(Value, FrictionCoef, Type='Force')[source]
Draw(SectionFunction=<function circlespacking>, Secargs=None, standalone=True, fig=None)[source]

Draws the braid for preview purposes, depends on the plot backend chosen by the end-user

Valid parameters: SectionFunction –> python function that will be call on **Sceargs The section function should remains as default for now since the braid object is not yet compatible with other section shapes.

Secargs –> tuple of arguments for the section function, if None, this will be set to (self.R,self.BundleR,self.SparsingCoeff)

standalone —> parameter that should always appear in draw functions for inPy.Instance subclasses, if True (default) the plot will be shown directly, if False, a figure object is returned

fig —> this is used if you want to add the braid to a previously existing figure object

Generate_AssemblyINP_String(R=0, AddDummy=True)[source]
Generate_CouplingINP_String(R=0, AddDummy=True)[source]
Generate_PartINP_String(R=0, AddDummy=True)[source]
circlespacking(yarnR, SparsingCoeff=0)
class Classes.Wired_Structures.Strand(InitShapeFunction, PathGenerationFunction, Line, Shargs=None, Shkwargs=None, Pthargs=None, Pthkwargs=None, **kwargs)[source]

Bases: object

Draw()[source]
GenerateInpString(Config=['Truss', 'Beam'], FileName=None)[source]
GeneratePaths()[source]
class path(Lx=[], Ly=[], Lz=[])

Bases: object

Init3DHelix(theta, DirectionParam, Pitch, Nby, Dbyin, Dbyout, PlaitSegments)

Credits to Louis for most of the code in this function, most of it comes from a matlab script he had written that I converted in Python

Init3DSinus(LinearMatrix, Lengh, NbPoints, Omega, Phi, R0, Cth, Th0, OffX=0, OffY=0, OffZ=0)

The linear matrix parameter is defined as follow:

[[Cx,Cy,Cz],
[Ax,Ay,Az]]

Équation paramétrique de la droite {x = Cx*t+Ax;y = Cy*t+Ay;z = Cz*t+Az}

Équation du sinus: définie en coordonées cylindriques autour de x x -> x ; y -> r sin(theta) ; y -> r cos(theta) {r = R0*sin(Omega*x+Phi), theta = Cth*x+Th0}

OffX, OffY and OffZ are used to add offset to the filaments generate (between each filament in a strand for example)

InitLinear(LinearMatrix, Lengh, NbPoints, OffX=0, OffY=0, OffZ=0)

Équation paramétrique de la droite {x = Cx*t+Ax;y = Cy*t+Ay;z = Cz*t+Az}

MakeNodeList(ID0=0, R=0, YarnR=0, SparsingCoeff=0)