diff --git a/specklepy/objects/structural/__init__.py b/specklepy/objects/structural/__init__.py new file mode 100644 index 0000000..4c182fd --- /dev/null +++ b/specklepy/objects/structural/__init__.py @@ -0,0 +1,40 @@ +"""Builtin Speckle object kit.""" + +from specklepy.objects.structural.analysis import * +from specklepy.objects.structural.properties import * +from specklepy.objects.structural.material import * +from specklepy.objects.structural.geometry import * +from specklepy.objects.structural.loading import * +from specklepy.objects.structural.axis import Axis + +__all__ = [ + "Element1D", + "Element2D", + "Element3D", + "Axis", + "Node", + "Restraint", + "Load", + "LoadBeam", + "LoadCase", + "LoadCombinations", + "LoadFace", + "LoadGravity", + "LoadNode", + "Model", + "ModelInfo", + "ModelSettings", + "ModelUnits", + "Concrete", + "Material", + "Steel", + "Timber", + "Property", + "Property1D", + "Property2D", + "Property3D", + "PropertyDamper", + "PropertyMass", + "PropertySpring", + "SectionProfile", +] diff --git a/specklepy/objects/structural_analysis.py b/specklepy/objects/structural/analysis.py similarity index 77% rename from specklepy/objects/structural_analysis.py rename to specklepy/objects/structural/analysis.py index 531b4c8..ed57129 100644 --- a/specklepy/objects/structural_analysis.py +++ b/specklepy/objects/structural/analysis.py @@ -2,11 +2,9 @@ from enum import Enum import enum from typing import Any, List, Optional -from .base import Base -from .encoding import CurveArray, CurveTypeEncoding, ObjectArray -from .units import get_encoding_from_units, get_units_from_encoding -from .geometry import * -from .structural_properties import * +from ..base import Base +from ..geometry import * +from .properties import * STRUCTURAL_ANALYSIS = "Objects.Structural.Analysis." @@ -27,7 +25,7 @@ class ModelUnits(Base, speckle_type=STRUCTURAL_ANALYSIS + "ModelUnits"): strain: str = None -class ModelSetttings(Base, speckle_type=STRUCTURAL_ANALYSIS + "ModelSettings"): +class ModelSettings(Base, speckle_type=STRUCTURAL_ANALYSIS + "ModelSettings"): modelUnits: ModelUnits = None steelCode: str = None concreteCode: str = None @@ -39,7 +37,7 @@ class ModelInfo(Base, speckle_type=STRUCTURAL_ANALYSIS + "ModelInfo"): description: str = None projectNumber: str = None projectName: str = None - settings: ModelSetttings = None + settings: ModelSettings = None initials: str = None application: str = None diff --git a/specklepy/objects/structural/axis.py b/specklepy/objects/structural/axis.py new file mode 100644 index 0000000..57266bd --- /dev/null +++ b/specklepy/objects/structural/axis.py @@ -0,0 +1,8 @@ +from ..base import Base +from ..geometry import Plane + + +class Axis(Base, speckle_type="Objects.Structural.Geometry.Axis"): + name: str = None + axisType: str = None + plane: Plane = None \ No newline at end of file diff --git a/specklepy/objects/structural_geometry.py b/specklepy/objects/structural/geometry.py similarity index 87% rename from specklepy/objects/structural_geometry.py rename to specklepy/objects/structural/geometry.py index 28f246b..e37fd08 100644 --- a/specklepy/objects/structural_geometry.py +++ b/specklepy/objects/structural/geometry.py @@ -2,17 +2,15 @@ from enum import Enum import enum from typing import Any, List, Optional -from .base import Base -from .encoding import CurveArray, CurveTypeEncoding, ObjectArray -from .units import get_encoding_from_units, get_units_from_encoding -from .geometry import * -from .structural_properties import * +from ..base import Base +from ..geometry import * +from .properties import * +from .axis import Axis STRUCTURAL_GEOMETRY = "Objects.Structural.Geometry" class ElementType1D(int, Enum): - Beam = 0 Brace = 1 Bar = 2 @@ -30,7 +28,6 @@ class ElementType1D(int, Enum): class ElementType2D(int, Enum): - Quad4 = 0 Quad8 = 1 Triangle3 = 2 @@ -38,7 +35,6 @@ class ElementType2D(int, Enum): class ElementType3D(int, Enum): - Brick8 = 0 Wedge6 = 1 Pyramid5 = 2 @@ -111,9 +107,3 @@ class Element3D(Base, speckle_type=STRUCTURAL_GEOMETRY + ".Element3D"): # class Storey needs ependency on built elements first - - -class Axis(Base, speckle_type=STRUCTURAL_GEOMETRY + ".Axis"): - name: str = None - axisType: str = None - plane: Plane = None diff --git a/specklepy/objects/structural_loading.py b/specklepy/objects/structural/loading.py similarity index 93% rename from specklepy/objects/structural_loading.py rename to specklepy/objects/structural/loading.py index f9d7e4e..359434e 100644 --- a/specklepy/objects/structural_loading.py +++ b/specklepy/objects/structural/loading.py @@ -1,10 +1,8 @@ from enum import Enum from typing import Any, List, Optional -from .base import Base -from .encoding import CurveArray, CurveTypeEncoding, ObjectArray -from .units import get_encoding_from_units, get_units_from_encoding -from .structural_geometry import * +from ..base import Base +from .geometry import * STRUCTURAL_LOADING = "Objects.Structural.Loading." diff --git a/specklepy/objects/structural_material.py b/specklepy/objects/structural/material.py similarity index 90% rename from specklepy/objects/structural_material.py rename to specklepy/objects/structural/material.py index 0e93560..6f076a3 100644 --- a/specklepy/objects/structural_material.py +++ b/specklepy/objects/structural/material.py @@ -1,9 +1,8 @@ from enum import Enum from typing import Any, List, Optional -from .base import Base -from .encoding import CurveArray, CurveTypeEncoding, ObjectArray -from .units import get_encoding_from_units, get_units_from_encoding +from ..base import Base + STRUCTURAL_MATERIALS = "Objects.Structural.Materials" diff --git a/specklepy/objects/structural_properties.py b/specklepy/objects/structural/properties.py similarity index 94% rename from specklepy/objects/structural_properties.py rename to specklepy/objects/structural/properties.py index af226c0..ebfdb08 100644 --- a/specklepy/objects/structural_properties.py +++ b/specklepy/objects/structural/properties.py @@ -1,13 +1,11 @@ from enum import Enum from typing import Any, List, Optional -from .structural_geometry import Axis -from .base import Base -from .encoding import CurveArray, CurveTypeEncoding, ObjectArray -from .units import get_encoding_from_units, get_units_from_encoding +from ..base import Base -from .structural_material import * +from .material import * +from .axis import Axis STRUCTURAL_PROPERTY = "Objectives.Structural.Properties" @@ -96,6 +94,18 @@ class Property(Base, speckle_type=STRUCTURAL_PROPERTY): name: str = None +class SectionProfile(Base, speckle_type=STRUCTURAL_PROPERTY + ".SectionProfile"): + name: str = None + shapeType: ShapeType = None + area: float = 0.0 + Iyy: float = 0.0 + Izz: float = 0.0 + J: float = 0.0 + Ky: float = 0.0 + weight: float = 0.0 + units: str = None + + class Property1D(Property, speckle_type=STRUCTURAL_PROPERTY + ".Property1D"): memberType: MemberType = None Material: Material = None @@ -174,18 +184,6 @@ class PropertySpring(Property, speckle_type=STRUCTURAL_PROPERTY + ".PropertySpri frictionCoefficient: float = 0.0 -class SectionProfile(Base, speckle_type=STRUCTURAL_PROPERTY + ".SectionProfile"): - name: str = None - shapeType: ShapeType = None - area: float = 0.0 - Iyy: float = 0.0 - Izz: float = 0.0 - J: float = 0.0 - Ky: float = 0.0 - weight: float = 0.0 - units: str = None - - class ReferenceSurfaceEnum(int, Enum): Concrete = 0 Steel = 1 @@ -213,4 +211,4 @@ class shapeType(int, Enum): Rebar = 8 Tendon = 9 ColdFormed = 10 - Other = 11 \ No newline at end of file + Other = 11