Skip to content

Instantly share code, notes, and snippets.

@MaximilianFranz
Created December 1, 2021 07:55
Show Gist options
  • Save MaximilianFranz/253d0de9d42a95159a6e46b0c6dc4866 to your computer and use it in GitHub Desktop.
Save MaximilianFranz/253d0de9d42a95159a6e46b0c6dc4866 to your computer and use it in GitHub Desktop.
Pydantic Schema from thy SkyCiv S3DModel JSON Schema
See the the generated schema below.
# generated by datamodel-codegen:
# filename: https://skyciv.com/api/v3/json/v3-schema.json
# timestamp: 2021-12-01T07:52:36+00:00
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel, Extra, Field, PositiveFloat, confloat, conint, constr
class Precision(Enum):
int_0 = 0
int_1 = 1
fixed = 'fixed'
exponential = 'exponential'
class VerticalAxis(Enum):
Y = 'Y'
Z = 'Z'
y = 'y'
z = 'z'
class ProjectionSystem(Enum):
orthographic = 'orthographic'
perspective = 'perspective'
class NonLinearTheory(Enum):
small = 'small'
finite = 'finite'
class Settings(BaseModel):
units: Optional[Any] = Field(
None,
description="Structure the data to pass 'oneOf' the schemas below.",
title='The units Schema',
)
precision: Optional[Precision] = Field(
'fixed',
description='Selects the type of precision to receive your output.',
title='The precision Schema',
)
precision_values: Optional[int] = Field(
3,
description='The number of precision values to receive for the type of precision selected.',
title='The precision_values Schema',
)
evaluation_points: Optional[conint(ge=3, le=50)] = Field(
5,
description='The number of points along each member which a solution is evaluated. Maximum possible value is 50.',
title='The evaluation_points Schema',
)
vertical_axis: Optional[VerticalAxis] = Field(
'Y',
description="Set 'Y' or 'Z' as the vertical axis.",
title='The vertical_axis Schema',
)
projection_system: Optional[ProjectionSystem] = Field(
'orthographic',
description="Set 'orthographic' or 'perspective as the projection system for the model view.",
title='The projection_system Schema',
)
solver_timeout: Optional[int] = Field(
90,
description='Set the allowable time in minutes for the solver to work before timing out. Base on the size of your structure.',
title='The solver_timeout Schema',
)
accurate_buckling_shape: Optional[bool] = Field(
False,
description='This setting does not affect buckling values and factors. If enabled when a buckling analysis is performed then only the accuracy of the displayed buckled shape will be improved, however it will take longer to solve.',
title='The accurate_buckling_shape Schema',
)
buckling_johnson: Optional[bool] = Field(
False,
description='Use the parabolic or J.B. Johnson formula which is a more conservative approach for buckling of intermediate-length columns. The Johnson formula will be applied for critical stresses above half the yield strength.',
title='The buckling_johnson Schema',
)
non_linear_tolerance: Optional[
Union[
confloat(ge=0.1, le=10.0),
constr(regex=r'([1-9].[0-9]+)|(^10$)|(^[1-9]$)|(^[0].[0-9]+$)'),
]
] = Field(
1,
description='Non-Linear Analysis will continue to solve until this tolerance (relative error percentage) is met. A smaller number takes longer for convergence.',
title='The non_linear_tolerance Schema',
)
non_linear_theory: Optional[NonLinearTheory] = Field(
'small',
description='Finite Displacement theory takes into account the full movement of the member and is suitable when the displacement is very large. If displacement is small there will be negligible difference between Small and Finite Displacement Theory.',
title='The non_linear_theory Schema',
)
auto_stabilize_model: Optional[bool] = Field(
False,
description='Enable this if your model has stability issues, especially if the non-linear analysis will not converge. The solver will attempt to automatically stabilize nodes that are not restrained. Recommended to leave this disabled unless you are having issues with stability.',
title='The auto_stabilize_model Schema',
)
class Details(BaseModel):
name: Optional[constr(regex=r'(^.*)$')] = None
designer: Optional[constr(regex=r'(^.*)$')] = None
notes: Optional[constr(regex=r'(^.*)$')] = None
class Nodes(BaseModel):
class Config:
extra = Extra.forbid
x: float
y: float
z: float
class Type(Enum):
normal = 'normal'
normal_continuous = 'normal_continuous'
continuous = 'continuous'
compression = 'compression'
tension = 'tension'
cable = 'cable'
rigid = 'rigid'
joist = 'joist'
class Members(BaseModel):
type: Optional[Type] = Field(
'normal',
description="Optional property. Accepts 'normal' or 'cable'. Defaults to 'normal' if this is not specified. If 'cable' is specified, then there are consequences for what is assigned to a few other properties. rotation_angle is set to 0. fixity_A and fixity_B is set to 'FFFRRR'. All offset properties assigned 0.",
title='The type Schema',
)
node_A: conint(ge=1) = Field(
...,
description='The starting node. Identifed by the node ID.',
title='The node_A Schema',
)
node_B: conint(ge=1) = Field(
...,
description='The ending node. Identifed by the node ID.',
title='The node_B Schema',
)
rotation_angle: Optional[confloat(ge=-360.0, le=360.0)] = Field(
None,
description="Rotate the member in degrees about its own axis. If 'type' property is 'cable', then this is assigned 0 (even if another value is specified here).",
examples=[0],
title='The rotation_angle Schema',
)
fixity_A: Optional[constr(regex=r'^[FSRfsr]{6}$')] = Field(
None,
description="How the member is connected about node A represented by a restraint code. The first three characters represent translational degrees of freedom in the local x, y, and z axes. The last 3 character represent rotational degrees of freedom in the local x, y, and z axes. F = Fixed and R = Released. If 'type' property is 'cable' then this is assigned 'FFFRRR' (even if another value is specified here).",
examples=['FFFFFF'],
title='The fixity_A Schema',
)
fixity_B: Optional[constr(regex=r'^[FSRfsr]{6}$')] = Field(
'',
description="How the member is connected about node B represented by a restraint code. If 'type' property is 'cable', then this is assigned 'FFFRRR' (even if another value is specified here).",
examples=['FFFFFF'],
title='The fixity_B Schema',
)
offset_Ax: Optional[Union[float, str]] = Field(
None,
description="The local x distance that the member is offset from its centroid at node. If 'type' property is 'cable', then this is assigned 0 (even if another value is specified here).",
title='The offset_Ax Schema',
)
offset_Ay: Optional[Union[float, str]] = Field(
None,
description="The local y distance that the member is offset from its centroid at node. If 'type' property is 'cable', then this is assigned 0 (even if another value is specified here).",
title='The offset_Ay Schema',
)
offset_Az: Optional[Union[float, str]] = Field(
None,
description="The local z distance that the member is offset from its centroid at node. If 'type' property is 'cable', then this is assigned 0 (even if another value is specified here).",
title='The offset_Az Schema',
)
offset_Bx: Optional[Union[float, str]] = Field(
None,
description="The local x distance that the member is offset from its centroid at node. If 'type' property is 'cable', then this is assigned 0 (even if another value is specified here).",
title='The offset_Bx Schema',
)
offset_By: Optional[Union[float, str]] = Field(
None,
description="The local y distance that the member is offset from its centroid at node. If 'type' property is 'cable', then this is assigned 0 (even if another value is specified here).",
title='The offset_By Schema',
)
offset_Bz: Optional[Union[float, str]] = Field(
None,
description="The local z distance that the member is offset from its centroid at node. If 'type' property is 'cable', then this is assigned 0 (even if another value is specified here).",
title='The offset_Bz Schema',
)
cable_length: Optional[Optional[Union[float, str]]] = Field(
None,
description="Optional property. Only relevant if 'type' property is set to 'cable', but even if the 'type' is a 'cable', it is optional to assign. A cable length can be specified to account for sagging or pre-tension. Do not set this property if you do not need to assign pre-tension or sagging.",
title='The cable_length Schema',
)
class Type1(Enum):
auto = 'auto'
class Diaphragm(Enum):
rigid = 'rigid'
no = 'no'
class Plates(BaseModel):
nodes: List[int] = Field(
...,
description='The nodes which make up the plate. A minimum of 3 nodes are required to specify a plate. Enter this as a string with double quotes, with each node id number separated by commas.',
examples=['4,5,7,6'],
regex='^([1-9]{1}[0-9]*,)+[1-9][0-9]*$',
title='The Nodes Schema',
)
thickness: PositiveFloat = Field(
...,
description='The thickness of the plate.',
examples=[50],
title='The thickness Schema',
)
material_id: conint(ge=1) = Field(
...,
description="The material of the plate. Identified by the material ID defined in the 'materials' object.",
title='The material_id Schema',
)
rotZ: float = Field(
...,
description="Rotation of plate about the plate's local Z (normal) axis in degrees.",
title='The rotZ Schema',
)
type: Type1 = Field(
...,
description="Currently only accepts 'mindlin'. Mindlin plates take into account shear deformations based on the Mindlin-Reissner Theory. Plans to implement the Kirchhoff Plate is in our future works list.",
title='The type Schema',
)
offset: float = Field(
...,
description='Offset of the plate in its local z-axis.',
title='The offset Schema',
)
state: constr(regex=r'stress|strain') = Field(
...,
description="'stress' or 'strain' denotes whether the plate is in a state of 'Plane Stress' or 'Plane Stress'.",
title='The state Schema',
)
holes: Optional[List[Any]] = Field(None, title='The holes Schema')
diaphragm: Optional[Diaphragm] = Field('no', title='The diaphragm Schema')
membrane_thickness: Optional[Optional[Union[float, str]]] = Field(
0,
description='Membrane thickness of the plate.',
title='The membrane thickness Schema',
)
shear_thickness: Optional[Optional[Union[float, str]]] = Field(
0,
description='Shear thickness of the plate.',
title='The shear thickness Schema',
)
bending_thickness: Optional[Optional[Union[float, str]]] = Field(
0,
description='Bending thickness of the plate.',
title='The bending thickness Schema',
)
class MeshedPlates(BaseModel):
node_A: conint(ge=1) = Field(
...,
description='The first node of the meshed plate. Meshed plates must be quadrilateral elements.',
title='The node_A Schema',
)
node_B: conint(ge=1) = Field(
...,
description='The second node of the meshed plate. Meshed plates must be quadrilateral elements.',
title='The node_B Schema',
)
node_C: conint(ge=1) = Field(
...,
description='The third node of the meshed plate. Meshed plates must be quadrilateral elements.',
title='The node_C Schema',
)
node_D: conint(ge=1) = Field(
...,
description='The fourth node of the meshed plate. Meshed plates must be quadrilateral elements.',
title='The node_D Schema',
)
parent_plate: conint(ge=1) = Field(
...,
description='The id of the plate which the meshed plate originated from.',
title='The parent_plate Schema',
)
rotZ: float = Field(
...,
description="Rotation of plate about the plate's local Z (normal) axis in degrees.",
title='The rotZ Schema',
)
class Aux(BaseModel):
composite: bool = Field(..., title='The composite Schema')
Qz: float = Field(..., title='The Qz Schema')
Qy: float = Field(..., title='The Qy Schema')
centroid_point: List[float] = Field(
..., max_items=2, min_items=2, title='The centroid_point Schema'
)
centroid_length: List[float] = Field(
..., max_items=2, min_items=2, title='The centroid_length Schema'
)
depth: float = Field(..., title='The depth Schema')
width: float = Field(..., title='The width Schema')
alpha: float = Field(..., title='The alpha Schema')
Zy: Optional[float] = Field(None, title='The Zy Schema')
Zz: Optional[float] = Field(None, title='The Zz Schema')
warping_constant: Optional[float] = Field(None, title='The warping_constant Schema')
shear_area_z: float = Field(..., title='The shear_area_z Schema')
shear_area_y: float = Field(..., title='The shear_area_y Schema')
torsion_radius: float = Field(..., title='The torsion_radius Schema')
class Section(BaseModel):
version: Optional[Union[conint(ge=1), constr(regex=r'^[0-9]+$')]] = Field(
None,
description="The version of the 'Section Builder' that was used to construct this object.",
examples=[1],
title='The version Schema',
)
name: Optional[constr(regex=r'^(.*)$')] = Field(
'',
description='The name of your section. If nothing is entered, the name will default to the (rounded) height x width dimension.',
examples=['203 x 203'],
title='The name Schema',
)
area: PositiveFloat = Field(
..., description='Cross sectional area.', title='The area Schema'
)
Iy: PositiveFloat = Field(
...,
description='Area moment of inertia about the y axis.',
title='The Iy Schema',
)
Iz: PositiveFloat = Field(
...,
description='Area moment of inertia about the z axis.',
title='The Iz Schema',
)
J: PositiveFloat = Field(..., description='Torsion constant.', title='The J Schema')
material_id: conint(ge=1) = Field(
...,
description='The ID of the material that is assigned to the cross section. Materials are defined in its own object.',
title='The material_id Schema',
)
shear_area_z: Optional[Optional[float]] = Field(
None,
description="Optional. Do not get confused between this property and the one with the same name within the 'aux' property. Shear Area in the Z-axis. Leave this value as Empty or Zero for a Euler-Bernoulli Beam (Recommended). Enter a value for a Timoshenko Beam (i.e. where shear deformation is not neglible).",
examples=[500, None],
title='The shear_area_z Schema',
)
shear_area_y: Optional[Optional[float]] = Field(
None,
description="Optional. Do not get confused between this property and the one with the same name within the 'aux' property. Shear Area in the Y-axis. Leave this value as Empty or Zero for a Euler-Bernoulli Beam (Recommended). Enter a value for a Timoshenko Beam (i.e. where shear deformation is not neglible).",
examples=[800, None],
title='The shear_area_y Schema',
)
aux: Optional[Aux] = Field(
None,
description="The 'aux' property is an object containing various property values. It contains the geometric coordinates of the cross section among other properties which are calculated via the 'Section Builder' software. For brevity, the individual properties are not detailed here. To understand how to create a section via the 'Section Builder' and implement it into the API, please contact us at info@skyciv.com",
title='The aux Schema',
)
class Section1(BaseModel):
load_section: List[str] = Field(..., title='The Load Section Schema')
material_id: conint(ge=1) = Field(
...,
description='The material attached to this particle section.',
title='The Material ID Schema',
)
class Section2(BaseModel):
load_section: Optional[List[str]] = Field(None, title='The Load Section Schema')
material_id: conint(ge=1) = Field(
...,
description='The material attached to this particle section.',
title='The Material ID Schema',
)
class Materials(BaseModel):
name: constr(regex=r'^(.*)$') = Field(
...,
description='The name of the material.',
examples=['Structural Steel'],
title='The name Schema',
)
density: PositiveFloat = Field(
..., description='The density of the material.', title='The density Schema'
)
elasticity_modulus: PositiveFloat = Field(
...,
description="Modulus of elasticity of the material. Also known as Young's Modulus.",
title='The elasticity_modulus Schema',
)
poissons_ratio: PositiveFloat = Field(
...,
description="Poisson's Ratio, also known as coefficient of expansion.",
title='The poissons_ratio Schema',
)
class Supports(BaseModel):
node: conint(ge=1) = Field(..., title='The node Schema')
restraint_code: constr(regex=r'^[FSRfsr]{6}$') = Field(
...,
description='A 6 character restraint code. The first three characters represent translational degrees of freedom in the global x, y, and z axes. The last 3 character represent rotational degrees of freedom in the global x, y, and z axes. F = Fixed, R = Released, S = Spring supported.',
examples=['FFFFFF'],
title='The restraint_code Schema',
)
tx: Optional[confloat(ge=0.0)] = Field(
0,
description="Spring stiffness for translation in the x axis. Only applies if the restraint code has an 'S' character set in the x translational direction.",
title='The tx Schema',
)
ty: Optional[confloat(ge=0.0)] = Field(
0,
description="Spring stiffness for translation in the y axis. Only applies if the restraint code has an S' character set in the y translational direction.",
title='The ty Schema',
)
tz: Optional[confloat(ge=0.0)] = Field(
0,
description="Spring stiffness for translation in the z axis. Only applies if the restraint code has an 'S' character set in the z translational direction.",
title='The tz Schema',
)
rx: Optional[confloat(ge=0.0)] = Field(
0,
description="Spring stiffness for rotation in the x axis. Only applies if the restraint code has an 'S' character set in the x rotational direction.",
title='The rx Schema',
)
ry: Optional[confloat(ge=0.0)] = Field(
0,
description="Spring stiffness for rotation in the y axis. Only applies if the restraint code has an 'S' character set in the y rotational direction.",
title='The ry Schema',
)
rz: Optional[confloat(ge=0.0)] = Field(
0,
description="Spring stiffness for rotation in the z axis. Only applies if the restraint code has an 'S'character set in the z rotational direction.",
title='The rz Schema',
)
direction_code: Optional[constr(regex=r'^[BPN]{6}$|()')] = Field(
'',
description="A 6 character code indicating support direction on all axes. 'B' for both positive and negative directions along the axis. 'P' for positive-only direction and 'N' for negative-only direction.",
examples=['BBBBBB'],
title='The direction_code Schema',
)
class Settlements(BaseModel):
node: conint(ge=1) = Field(
...,
description='The node location where the settlement is applied. The value is the node ID.',
title='The Node Schema',
)
tx: float = Field(
...,
description='Displacement of settlement in the x axis.',
title='The tx Schema',
)
ty: float = Field(
...,
description='Displacement of settlement in the y axis.',
title='The ty Schema',
)
tz: float = Field(
...,
description='Displacement of settlement in the z axis.',
title='The tz Schema',
)
rx: float = Field(
...,
description='Rotatation of settlement in the x axis.',
title='The rx Schema',
)
ry: float = Field(
...,
description='Rotatation of settlement in the y axis.',
title='The ry Schema',
)
rz: float = Field(
...,
description='Rotatation of settlement in the z axis.',
title='The rz Schema',
)
class Type2(Enum):
N = 'N'
M = 'M'
n = 'n'
m = 'm'
class PointLoads(BaseModel):
type: Type2 = Field(
...,
description="The location where the point load is located. 'n' = located on a node. 'm' = located somewhere along the member.",
title='The Type Schema',
)
node: Optional[Optional[conint(ge=1)]] = Field(
None,
description="Contextual. Only include the property 'node' if applying the point load to a node. The value should be the node ID.",
title='The Node Schema',
)
member: Optional[Optional[conint(ge=1)]] = Field(
None,
description="Contextual. Only include the property 'member'if applying the point load somewhere along a member. The value should be the member ID.",
title='The Member Schema',
)
position: Optional[Optional[confloat(ge=0.0, le=100.0)]] = Field(
None,
description="Contextual. Only include the property 'position' if applying the point load somewhere along a member. This is the position along the member where the point load is applied, measured as a percentage along the member.",
examples=[30],
title='The Position Schema',
)
x_mag: float = Field(
...,
description='The magnitude of the point load force along x axis.',
title='The X_mag Schema',
)
y_mag: float = Field(
...,
description='The magnitude of the point load force along y axis.',
title='The Y_mag Schema',
)
z_mag: float = Field(
...,
description='The magnitude of the point load force along z axis.',
title='The Z_mag Schema',
)
load_group: str = Field(
...,
description='The load group which the point load is to be grouped to.',
title='The Load_group Schema',
)
class Type3(Enum):
n = 'n'
m = 'm'
N = 'N'
M = 'M'
class Moments(BaseModel):
type: Type3 = Field(
...,
description="The location where the point load is located. 'n' = located on a node. 'm' = located somewhere along the member.",
title='The type Schema',
)
node: Optional[Optional[conint(ge=1)]] = Field(
None,
description="Contextual. Only include the property 'node' if applying the moment to a node. The value should be the node ID.",
title='The node Schema',
)
member: Optional[Optional[conint(ge=1)]] = Field(
None,
description="Contextual. Only include the property 'member' if applying the moment somewhere along a member. The value should be the member ID.",
title='The member Schema',
)
position: Optional[confloat(ge=0.0, le=100.0)] = Field(
...,
description="Contextual. Only include the property 'position' if applying the moment somewhere along a member. This is the position along the member where the moment is applied, measured as a percentage along the member.",
examples=[30],
title='The position Schema',
)
x_mag: float = Field(
...,
description='The magnitude of the moment about the x axis. Positive = counter-clockwise, negative = clockwise.',
title='The x_mag Schema',
)
y_mag: float = Field(
...,
description='The magnitude of the moment about the y axis. Positive = counter-clockwise, negative = clockwise.',
title='The y_mag Schema',
)
z_mag: float = Field(
...,
description='The magnitude of the moment about the z axis. Positive = counter-clockwise, negative = clockwise.',
title='The z_mag Schema',
)
load_group: str = Field(
...,
description='The load group which the point load is to be grouped to.',
title='The Load_group Schema',
)
class Axes(Enum):
global_ = 'global'
local = 'local'
Global = 'Global'
Local = 'Local'
class DistributedLoads(BaseModel):
member: conint(ge=1) = Field(
...,
description='Member where the distributed load is applied. Identified by the member ID.',
title='The member Schema',
)
x_mag_A: float = Field(
...,
description='Magnitude of load in x direction at the starting position A.',
title='The x_mag_A Schema',
)
y_mag_A: float = Field(
...,
description='Magnitude of load in y direction at the starting position A.',
title='The y_mag_A Schema',
)
z_mag_A: float = Field(
...,
description='Magnitude of load in z direction at the starting position A.',
title='The z_mag_A Schema',
)
x_mag_B: float = Field(
...,
description='Magnitude of load in x direction at the finish position B.',
title='The x_mag_B Schema',
)
y_mag_B: float = Field(
...,
description='Magnitude of load in y direction at the finish position B.',
title='The y_mag_B Schema',
)
z_mag_B: float = Field(
...,
description='Magnitude of load in z direction at the finish position B.',
title='The z_mag_B Schema',
)
position_A: Optional[confloat(ge=0.0, le=100.0)] = Field(
...,
description='Position along member where the distributed load starts. Expressed as a percentage.',
examples=[30],
title='The position_A Schema',
)
position_B: Optional[confloat(ge=0.0, le=100.0)] = Field(
...,
description='Position along member where the distributed load ends. Expressed as a percentage.',
examples=[30],
title='The position_b Schema',
)
load_group: str = Field(
...,
description='The load group which the load belongs.',
title='The load_group Schema',
)
axes: Axes = Field(
...,
description="Specify either 'global' or 'local' to assign which axes are to be used to apply the distributed load.",
title='The axes Schema',
)
class Axes1(Enum):
global_ = 'global'
local = 'local'
class LoadDistribution(Enum):
uniform = 'uniform'
linear = 'linear'
class Pressures(BaseModel):
plate_id: Union[conint(ge=1), constr(regex=r'^[1-9]+[0-9]*$')] = Field(
...,
description='Plate where the pressure is applied. Identified by the plate ID.',
title='The plate_id Schema',
)
axes: Axes1 = Field(
...,
description="Specify either 'global' or 'local' to assign which axes are to be used to apply the pressure load.",
title='The axes Schema',
)
x_mag: float = Field(
...,
description='Magnitude of pressure in x direction, dependent on local or global axes setting.',
title='The x_mag Schema',
)
y_mag: float = Field(
...,
description='Magnitude of pressure in y direction, dependent on local or global axes setting.',
title='The y_mag Schema',
)
z_mag: float = Field(
...,
description='Magnitude of pressure in z direction, dependent on local or global axes setting.',
title='The z_mag Schema',
)
load_group: str = Field(
...,
description='The load group which the load belongs.',
title='The load_group Schema',
)
load_distribution: Optional[LoadDistribution] = Field(
'uniform',
description="Select between 'linear' and 'uniform' distribution.",
title='The load_distribution Schema',
)
class Type4(Enum):
one_way = 'one_way'
two_way = 'two_way'
column_wind_load = 'column_wind_load'
open_structure = 'open_structure'
class AreaLoads(BaseModel):
type: Type4 = Field(
..., description="This area load instance's type.", title='The type Schema'
)
nodes: List[int] = Field(
...,
description='The nodes comprising the area_load.',
examples=['4,5,7,6'],
regex='^([0-9]+,){2,3}([0-9]+)$',
title='The nodes Schema',
)
elevations: Optional[List[float]] = Field(
None,
description='Comma-seperated list of elevations in feet or metres for wind loads.',
regex='^(([0-9]+,)|([0-9]+[.]?[0-9]*,)|([0-9]*[.]?[0-9]+,))*(([0-9]+$)|([0-9]+[.]?[0-9]*$)|([0-9]*[.]?[0-9]+$))',
title='The elevations Schema',
)
column_direction: Optional[List[int]] = Field(
None,
description='The direction of your internal beams or columns. Enter two comma-seperated nodes e.g. 1,2. This would distribute the area loads along members in this direction.',
max_items=2,
min_items=2,
regex='[0-9]+,[0-9]+',
title='The column_direction Schema',
)
loaded_members_axis: Optional[Optional[str]] = Field(
None,
description='Pick up and apply loads to all members within corner nodes, or members along X,Y,Z axis only.',
title='The loaded_members_axis Schema',
)
LG: constr(regex=r'(^.+)$') = Field(
...,
description='The load group to which this load belongs.',
title='The LG Schema',
)
class DesignCode(Enum):
EN = 'EN'
ASCE = 'ASCE'
AS1170 = 'AS1170'
NBCC = 'NBCC'
ACI = 'ACI'
class Import(BaseModel):
design_code: Optional[DesignCode] = None
expand_wind_loads: Optional[bool] = None
class LoadCombinations(BaseModel):
class Config:
extra = Extra.forbid
import_: Optional[Import] = Field(None, alias='import')
class LoadCases(Enum):
Dead__unfavourable = 'Dead: unfavourable'
Dead__favourable = 'Dead: favourable'
Live__live = 'Live: live'
Wind__wind = 'Wind: wind'
Snow__snow = 'Snow: snow'
Seis__Earthquake_Accidental = 'Seis: Earthquake/Accidental'
class NodalMasses(BaseModel):
node_id: Optional[conint(ge=1)] = None
tx_mass: Optional[confloat(ge=0.0)] = None
ty_mass: Optional[confloat(ge=0.0)] = None
tz_mass: Optional[confloat(ge=0.0)] = None
rx_mass: Optional[confloat(ge=0.0)] = None
ry_mass: Optional[confloat(ge=0.0)] = None
rz_mass: Optional[confloat(ge=0.0)] = None
class Direction(Enum):
X_Y_Z = 'X,Y,Z'
X_Y = 'X,Y'
X_Z = 'X,Z'
Y_Z = 'Y,Z'
X = 'X'
Y = 'Y'
Z = 'Z'
class NodalMassesConversionMap(BaseModel):
factor: float
direction: Direction
class InputMethod(Enum):
integer_1 = 1
integer_2 = 2
class DesignCode1(Enum):
EN8 = 'EN8'
ASCE = 'ASCE'
_ = ''
class RsType(Enum):
type_1 = 'type_1'
type_2 = 'type_2'
class RsDir(Enum):
el_horizontal = 'el_horizontal'
el_vertical = 'el_vertical'
des_horizontal = 'des_horizontal'
des_vertical = 'des_vertical'
class RsGround(Enum):
A = 'A'
B = 'B'
C = 'C'
D = 'D'
E = 'E'
class DesignData(BaseModel):
saved: Optional[bool] = None
rs_type: Optional[RsType] = Field(None, title='The Response Spectrum Schema')
rs_dir: Optional[RsDir] = Field(None, title='The Response Spectrum Type Schema')
rs_peak: Optional[PositiveFloat] = Field(
None, title='The Peak Ground Acceleration Schema'
)
rs_imp_fac: Optional[confloat(ge=0.0)] = Field(
None, title='The Response Spectrum Importance Factor Schema'
)
rs_ground: Optional[RsGround] = Field(
None, title='The Response Spectrum Ground Type Schema'
)
rs_damp: Optional[PositiveFloat] = Field(
None, title='The Response Spectrum Damping Schema'
)
max_T: Optional[PositiveFloat] = Field(
None, title='The Maximum Period (Secs) Schema'
)
beta: Optional[PositiveFloat] = Field(None, title='The Lower Bound Factor Schema')
q_fac: Optional[PositiveFloat] = Field(None, title='The Behavior Factor Schema')
class XyDatum(BaseModel):
class Config:
extra = Extra.forbid
x: float
y: float
class LoadDir(Enum):
X = 'X'
Z = 'Z'
XZ = 'XZ'
Y = 'Y'
class LoadComboMethod(Enum):
CQC = 'CQC'
ABS = 'ABS'
SRSS = 'SRSS'
Linear = 'Linear'
class SpectralLoads(BaseModel):
input_method: InputMethod = Field(
...,
description="'1' if the load was generated via 'user input'. '2' if by 'design code'",
)
design_code: Optional[DesignCode1] = Field(
None,
description='The selected design code if the load was generated via design code.',
)
design_data: Optional[DesignData] = Field(None, title='The design_data Schema')
xy_data: Optional[List[XyDatum]] = Field(
None,
description='Values for the XY plot in pairs { Period T (X), Spectral Value (Y) }',
)
load_dir: Optional[LoadDir] = Field(None, description='Direction of the load.')
load_angle: Optional[confloat(ge=0.0, le=360.0)] = Field(
None, description="Angle of the load if 'XZ' was chosen for direction."
)
load_factor: Optional[float] = Field(
None, description='Factor multiplier for the load.'
)
load_combo_method: Optional[LoadComboMethod] = Field(
None, description='Method used to calculate the impact of load combinations.'
)
load_damping_ratio: Optional[float] = None
LG: Optional[Any] = Field(None, description='The load group this load belongs to')
class TheModelSchema(BaseModel):
settings: Settings = Field(
...,
description='The settings are defined in the properties of the settings object.',
title='The settings Schema',
)
details: Optional[Details] = Field(
None, description='Meta data for the model.', title='The details Schema'
)
nodes: Dict[constr(regex=r'^[1-9][0-9]*$'), Nodes] = Field(
...,
description='Each node is defined by an object. The properties x, y, and z represent the x, y, and z coordinates in the global axes respectively for that node.',
title='The nodes Schema',
)
members: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), Members]] = Field(
None,
description='Each member is defined by an object. Members are defined by two nodes, the section, rotation angle, and fixity of the member at each node.',
title='The members Schema',
)
plates: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), Plates]] = Field(
None,
description='Each plate is defined by an object.',
title='The plates Schema',
)
meshed_plates: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), MeshedPlates]] = Field(
None,
description='Each plate is defined by an object with properties. Plates are defined by the nodes making them up (3-4), their parent plate, and their rotation.',
title='The meshed_plates Schema',
)
sections: Dict[
constr(regex=r'^[1-9][0-9]*$'), Union[Section, Section1, Section2]
] = Field(
...,
description="Each section is defined as an object. If the 'Section Builder' software was used to define your section, an 'aux' property will be present. This property defines the geometry of the section.",
title='The sections Schema',
)
materials: Dict[constr(regex=r'^[1-9][0-9]*$'), Materials] = Field(
...,
description='Each material is defined as an object with properties.',
title='The materials Schema',
)
supports: Dict[constr(regex=r'^[1-9][0-9]*$'), Supports] = Field(
...,
description='Each support is defined by an object with properties. Supports are defined by their node position, restraint code, translational and rotational stiffness.',
title='The supports Schema',
)
settlements: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), Settlements]] = Field(
None,
description='Each settlement is defined by an object with properties. Settlements are defined by their node location, and their translational or rotational magnitude in each axis.',
title='The settlements Schema',
)
point_loads: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), PointLoads]] = Field(
None,
description='Each point load is defined by an object with properties depending on the location that the point load is applied. Point loads are defined by their location type (node or member), magnitude, and load group.',
title='The point_loads Schema',
)
moments: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), Moments]] = Field(
None,
description='Each moment is defined by an object with properties depending on the location that the point load is applied. Moments are defined by their location type (node or member), magnitude, and load group.',
title='The moments Schema',
)
distributed_loads: Optional[
Dict[constr(regex=r'^[1-9][0-9]*$'), DistributedLoads]
] = Field(
None,
description='Each distributed load is defined by an object with properties. Distributed loads are defined by their location type (node or member), magnitude, and load group.',
title='The distributed_loads Schema',
)
pressures: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), Pressures]] = Field(
None,
description='Each pressure is defined by an object with properties. Pressures are defined by the plate ID they are applied to, the reference axes, magnitude and load group.',
title='The pressures Schema',
)
area_loads: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), AreaLoads]] = Field(
None,
description='Each area load is defined by an object with properties.',
title='The area_loads Schema',
)
member_prestress_loads: Optional[
Dict[constr(regex=r'^[1-9][0-9]*$'), Dict[constr(regex=r'id'), conint(ge=1)]]
] = Field(None, title='The member_prestress_loads Schema')
self_weight: Optional[Dict[str, Any]] = Field(
None,
description='The self weight is an object defined by properties. It can be optionally enabled and applied a gravity multiplier in the x, y, or z axes',
title='The self_weight Schema',
)
load_combinations: Optional[LoadCombinations] = Field(
None,
description='Load combinations are assigned to forces and moments as a property in their objects. The load combinations object is used to assign a multiplier to each load combination defined',
title='The load_combinations Schema',
)
load_cases: Optional[
Union[
Dict[
constr(regex=r'^AISC$|^ASCE$'), Dict[constr(regex=r'^(.+)$'), LoadCases]
],
Dict[constr(regex=r'^AS$'), Dict[constr(regex=r'^(.+)$'), LoadCases]],
Dict[constr(regex=r'^EN$'), Dict[constr(regex=r'^(.+)$'), LoadCases]],
Dict[constr(regex=r'^NBCC$'), Dict[constr(regex=r'^(.+)$'), LoadCases]],
]
] = Field(None, title='The load_cases Schema')
nodal_masses: Optional[Dict[constr(regex=r'^[1-9][0-9]*$'), NodalMasses]] = Field(
None, title='The nodal_masses Schema'
)
nodal_masses_conversion_map: Optional[
Dict[constr(regex=r'^(.+)$'), NodalMassesConversionMap]
] = Field(None, title='The nodal_masses_conversion_map Schema')
spectral_loads: Optional[
Dict[constr(regex=r'^[1-9][0-9]*$'), SpectralLoads]
] = Field(
None,
description='Each spectral load is defined by an object with properties.',
title='The spectral_loads Schema',
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment