compas_model.binding

class compas_wood.binding.Globals[source]

Bases: object

Class to access global variables of the wood_nano library using class instance wood_globals:

>>> from compas_wood.binding import wood_globals
>>> wood_globals.distance_squared = 10
>>> wood_globals.face_to_face_side_to_side_joints_rotated_joint_as_average = True
>>> wood_globals.face_to_face_side_to_side_joints_all_treated_as_rotated = True
Attributes:
clipper_scaleint, default 1e6

The clipper scale.

clipper_areafloat, default 1e-2

The clipper area.

distancefloat, default 1e-1

The distance.

distance_squaredfloat, default 1e-2

The distance squared.

anglefloat, default 0.11

The angle.

path_and_file_for_jointsstr, default “”

The path and file for joints.

data_set_input_folderstr

The data set input folder.

data_set_output_filestr, default data_set_input_folder + “out.xml”

The data set output file.

data_set_output_databasestr, default data_set_input_folder + “out.db”

The data set output database.

joint_volume_extensionlist[float], default [0.0, 0.0, 0.0, 0.0, 0.0]

The joint volume extension, first 3 values are for xyz of the joint volume.

output_geometry_typeint, default 4

The output geometry type.

face_to_face_side_to_side_joints_all_treated_as_rotatedbool, default False

The face to face side to side joints all treated as rotated.

face_to_face_side_to_side_joints_rotated_joint_as_averagebool, default False

The face to face side to side joints rotated joint as average.

face_to_face_side_to_side_joints_dihedral_anglefloat, default 150.0

The face to face side to side joints dihedral angle.

limit_min_joint_lengthfloat, default 0.0

The limit min joint length.

existing_typeslist[str], read-only

The existing types of joints.

joints_parameters_and_typeslist[float], default:

300, 0.5, 3, // 1-9 ss_e_ip (side-to-side edge in-plane)

450, 0.64, 15, // 10-19 ss_e_op (side-to-side edge out-of-plane)

450, 0.5, 20, // 20-29 ts_e_p (top-to-side edge plane)

300, 0.5, 30, // 30-39 cr_c_ip (cross cutting in-plane)

6, 0.95, 40, // 40-49 tt_e_p (top-to-top edge plane)

300, 0.5, 58, // 50-59 ss_e_r (side-to-side edge rotated)

300, 1.0, 60 // 60-69 b (boundary)

custom_joints_ss_e_ip_malelist[Polyline], default []

Joinery polylines for custom side-to-side edge in-plane male joints.

custom_joints_ss_e_ip_femalelist[Polyline], default []

Joinery polylines for custom side-to-side edge in-plane female joints.

custom_joints_ss_e_op_malelist[Polyline], default []

Joinery polylines for custom side-to-side edge out-of-plane male joints.

custom_joints_ss_e_op_femalelist[Polyline], default []

Joinery polylines for custom side-to-side edge out-of-plane female joints.

custom_joints_ts_e_p_malelist[Polyline], default []

Joinery polylines for custom top-to-side edge in-plane male joints.

custom_joints_ts_e_p_femalelist[Polyline], default []

Joinery polylines for custom top-to-side edge in-plane female joints.

custom_joints_cr_c_ip_malelist[Polyline], default []

Joinery polylines for custom corner-to-corner in-plane male joints.

custom_joints_cr_c_ip_femalelist[Polyline], default []

Joinery polylines for custom corner-to-corner in-plane female joints.

custom_joints_tt_e_p_malelist[Polyline], default []

Joinery polylines for custom top-to-top edge in-plane male joints.

custom_joints_tt_e_p_femalelist[Polyline], default []

Joinery polylines for custom top-to-top edge in-plane female joints.

custom_joints_ss_e_r_malelist[Polyline], default []

Joinery polylines for custom side-to-side edge rounded male joints.

custom_joints_ss_e_r_femalelist[Polyline], default []

Joinery polylines for custom side-to-side edge rounded female joints.

custom_joints_b_malelist[Polyline], default []

Joinery polylines for custom base male joints.

custom_joints_b_femalelist[Polyline], default []

Joinery polylines for custom base female joints.

compas_wood.binding.closed_mesh_from_polylines(input_polyline_pairs)[source]

Get closed mesh from polylines, where the first two polylines are the top and bottom polylines, and the rest are the holes.

Parameters:
input_polyline_pairslist[list[compas.geometry.Polyline]]

List of polylines that represents the timber elements.

Returns:
compas.datastructures.Mesh

closed mesh

compas_wood.binding.get_connection_zones(input_polyline_pairs, input_insertion_vectors=[], input_joint_types=[], input_three_valence_element_indices_and_instruction=[], input_adjacency=[], input_joint_parameters_and_types=[], input_search_type=0, input_scale=[1, 1, 1], input_output_type=3, input_joint_volume_parameters=[0, 0, 0], input_custom_joints=[], input_custom_joints_types=[])[source]

Get connection zones for the given input parameters.

Parameters:
input_polyline_pairslist[list[compas.geometry.Polyline]]

List of polylines that represents the timber elements.

input_insertion_vectorslist[compas.geometry.Vector], optional

List of insertion vectors.

input_joint_typeslist[int], optional

List of joint types.

input_three_valence_element_indices_and_instructionlist[int], optional

List of three valence element indices and instruction.

input_adjacencylist[int], optional

List of adjacency.

input_joint_parameters_and_typeslist[float], optional

List of joint parameters and types.

input_search_typeint, optional

Search type.

input_scalelist[float], optional

Scale.

input_output_typeint, optional

Output type.

input_joint_volume_parameterslist[float], optional

Joint volume parameters.

input_face_to_face_side_to_side_joints_all_treated_as_rotatedbool, optional

Face to face side to side joints all treated as rotated.

input_custom_jointslist[compas.geometry.Point], optional

Custom joints.

input_custom_joints_typeslist[int], optional

Custom joints types.

input_face_to_face_side_to_side_joints_rotated_joint_as_averagebool, optional
Returns:
list[list[compas.geometry.Polyline]]

List of polylines that represents the timber elements.

list[wood_nano.CutType2]

List of cut types.

compas_wood.binding.joints(input_polyline_pairs, search_type=0)[source]

Get joints for the given input parameters. This is the very first step in the process of creating a timber structure - detection of interfaces.

Parameters:
input_polyline_pairslist[list[compas.geometry.Polyline]]

List of polylines that represents the timber elements.

search_typeint, optional

Search type.

Returns:
list[list[int]]

List of element pairs.

list[compas.geometry.Polyline]

List of joint areas.

list[int]

List of joint types.

compas_wood.binding.mesh_boolean_difference_from_polylines(polylines_lists)[source]

The polylines lists first items represnts elements outlines and the second items represents joinery outlines.

Parameters:
polylines_listslist of list of compas.geometry.Polyline

The polylines lists first items represnts elements outlines and the second items represents joinery outlines.

Returns:
list of compas.datastructures.Mesh

The meshes created by the boolean difference of the elements and joineries.

compas_wood.binding.read_xml_polylines(foldername='/home/petras/brg/2_code/wood_nano/src/wood/cmake/src/wood/dataset/', filename='type_plates_name_cross_vda_hexshell_reciprocal', scale=1)[source]

Read polylines from XML file.

Parameters:
foldernamestr, optional

Foldername.

filename_of_datasetstr, optional

Filename of dataset.

scalefloat, optional

Scale.

Returns:
list[compas.geometry.Polyline]

List of polylines.

compas_wood.binding.read_xml_polylines_and_properties(foldername='/home/petras/brg/2_code/wood_nano/src/wood/cmake/src/wood/dataset/', filename_of_dataset='type_plates_name_top_to_side_and_side_to_side_outofplane_annen_grid_small', scale=0.01)[source]

Read polylines from XML file with attributes:

  • insertion vectors per face

  • input_joints_types per face

  • input_three_valence_element_indices_and_instruction

  • input_adjacency per curren and next elements and their faces.

Parameters:
foldernamestr, optional

Foldername.

filename_of_datasetstr, optional

Filename of dataset.

scalefloat, optional

Scale.

Returns:
list[compas.geometry.Polyline]

List of polylines.

list[list[compas.geometry.Vector]]

List of vectors.

list[list[int]]

List of joint types.

list[list[int]]

List of three valence element indices and instruction.

list[int]

List of adjacency.

compas_wood.binding.rtree(polylines)[source]

Given a list of polylines-pairs find neighbors between them via aabb and obb collisions. Polyline pairs means the top and bottom polylines of plates.

Parameters:
polylineslist[compas.geometry.Polyline]

List of polylines.

Returns:
list[int]

List of neighbors.

list[compas.geometry.Box]

List of aabb boxes.

list[compas.geometry.Box]

List of obb boxes.

compas_wood.binding.test()[source]

Test if wood_nano package is loaded by printing message in C++.