S3D.model
The S3D.model
namespace provides functions which take action on the s3d_model
object.
note
To create a model object, see s3d_model.
S3D.model.set
#
Setting a model is the first step to running any analysis, design or running any other functionality on a structural model.
Key | Type | Accepts | Description |
---|---|---|---|
s3d_model | object | A s3d_model object | An object containing information that represents a Structural 3D model. |
The response will confirm whether or not the model was successfully set.
S3D.model.set
S3D.model.get
#
Once the model is set, you can request the model data at any time by calling the function S3D.model.get
. This function takes no arguments, and will return the s3d_model
object.
important
S3D.model.get
will only work if S3D.model.set
has been called earlier in the session.
The response will return the s3d_model
object.
S3D.model.repair
#
S3D.model.repair
will run SkyCiv's repair model functionality. This will identify any issues with the model and repair them to ensure the analysis model is built correctly. To test the behaviour of these features, we recommend using the Repair Model function in the S3D UI.
important
S3D.model.set
must be called earlier in the session.
Key | Type | Accepts | Description | Default |
---|---|---|---|---|
checks | [string] | unused_nodes large_structure merge_nodes zero_members continuous_to_normal_members intersect_members default_section force_plate_mesh | An array of strings defining the checks to be performed. | all |
checks
#
unused_nodes
- scan model for nodes that are floating and disconnected.large_structure
- detect extremely slender members (used to detect unit issues).merge_nodes
- merge close nodes with a tolerance based on unit system.zero_members
- detect members that have the same start/end node.continuous_to_normal_members
- detect any members with intermediate nodes and splits them to ensure they are properly connected. This will also change the member type to 'normal'intersect_members
- detect and connect intersecting members.default_section
- find any members with no section data, add a default section.force_plate_mesh
- allow analysis to run without plates being meshed first.
The response will confirm whether or not the model was successfully repaired.
S3D.model.solve
#
Runs a structural analysis on your s3d_model
.
Key | Type | Accepts | Description | Default |
---|---|---|---|---|
analysis_type | string | linear , nonlinear , buckling , dynamic , response_spectrum | The type of analysis to be performed. | linear |
repair_model | boolean | true , false | If S3D.model.repair should be executed prior to solving. | false |
return_data | boolean | true , false | To minimize data downloaded, solve data will be removed. | true |
format | string | json , csv | Export results in particular file format. | json |
lc_filter | [string] | envelope , load_case , load_group , load_combo , envelope_abs_max | Only return specific data in the response. You can also provide names you have applied to load combination. E.g. LC1 . | All cases |
result_filter | [string] | reactions , member_displacements , member_forces , member_stresses , member_lengths , member_stations , member_discontinuities , member_minimums , member_maximums , member_peak_results , plate_displacements , plate_forces , plate_stresses , plate_minimums , plate_maximums , plate_peak_results , buckling , dynamic_frequency | Only return specific data in the response. | All results |
ignore_area_load_validation | boolean | true or false | Ignore area load variance checks and solve anyway | true |
allowable_area_load_variance | float | e.g 3 | Ignore area load variance that are below this percentage. In percentage as a whole number | true |
tip
Using the filter properties will drastically reduce the size of the response therefore saving on download data and time.
S3D.model.solve
The analysis results will return an object of all the load combination results in the following format. If the solver fails to run, it will return with a status: 1
and an error message to assist in debugging the issue.
S3D.model.takeScreenshot
#
Take screenshots of the model.
important
S3D.model.set
must be called earlier in the session.
Key | Type | Accepts | Description |
---|---|---|---|
views | [string] | iso , front , side , top , thumbnail , custom | Array of strings, defining the different perspectives to take a screenshot from. |
is_renderer | boolean | true , false | Take screenshots of the structure in the 3D renderer. |
wireframe_settings | object | An object as defined in wireframe_settings | An object defining additional settings. Only applicable to WIREFRAME display. |
renderer_settings | object | An object which matches the S3D Renderer settings: renderer_settings | An object defining additional settings. Only applicable to RENDERER display. |
custom_view | object optional | An object with x, y, z values | This object specifies the position of the camera in global 3D space { x: 100, y: 2, z: 3 } . Only applies when view=custom . |
scale | float optional | A number between 0 and 5 (default is 1) | Defines the scale slider for the graphics (loads and results). A higher number makes the scale larger. Only applicable to WIREFRAME display. |
zoom_factor | float optional | A number between -50 and 50 (default is 0 which is no zoom) | Defines the factor to zoom the graphics. A positive number zooms in while a negative number zooms out. Only applicable to WIREFRAME display. |
wireframe_settings
#
Input for Key | Type | Accepts | Description |
---|---|---|---|
show_nodes | boolean | true , false | If nodes should be visible. |
show_loads | boolean | true , false | If loads should be visible. |
show_plates | boolean | true , false | If plates should be visible. |
projection | string | perspective , orthographic | The projection of the model to the view-point. |
S3D.model.takeScreenshot
note
The response will return an object of screenshots in base64 format.
The following is an example of the isometric screenshot from the above sample:
S3D.model.mesh
#
Mesh the plates in the s3d_model
object.
Key | Type | Accepts | Description | Default |
---|---|---|---|---|
method | string | frontal_quads , frontal , adapt , packing_parallelograms , delaunay | Specify what type of mesher to use. | frontal |
granularity | integer | 1 -5 | Integer between 1 and 5 for level of granularity of mesh (1 is coarse, 5 is fine). | 1 |
plate_ids | [integer] | An array of plate ids. | Array of plates you wish to mesh. | All plates if property is not provided. |
S3D.model.script
#
Allows you to run custom JavaScript functions to access all S3D functionality such as intersecting or adding new nodes or members. Available functions can be found here.
Key | Type | Accepts | Description |
---|---|---|---|
script | string | A string of JavaScript | Define custom actions to run. Available functions can be found here. |
Note: Users can write to a pre-made global variable API_RETURN_DATA
and this will return back from the SkyCiv API. This allows you to return data you need from your operations.
The response will return the following message, as well as data you set to API_RETURN_DATA
S3D.model.getLocalAxisVectors
#
Returns the local axis vectors for each member.