compas_wood.binding
¤
Classes¤
Globals
¤
Class to access global variables of the wood_nano library.
Use the class instance wood_globals to access and modify global parameters.
Examples:
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_scale(int, default 1e6) –The clipper scale.
-
clipper_area(float, default 1e-2) –The clipper area.
-
distance(float, default 1e-1) –The distance.
-
distance_squared(float, default 1e-2) –The distance squared.
-
angle(float, default 0.11) –The angle.
-
path_and_file_for_joints(str, default "") –The path and file for joints.
-
data_set_input_folder(str) –The data set input folder.
-
data_set_output_file(str, default data_set_input_folder + "out.xml") –The data set output file.
-
data_set_output_database(str, default data_set_input_folder + "out.db") –The data set output database.
-
joint_volume_extension((list[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_type(int, default 4) –The output geometry type.
-
face_to_face_side_to_side_joints_all_treated_as_rotated(bool, default False) –The face to face side to side joints all treated as rotated.
-
face_to_face_side_to_side_joints_rotated_joint_as_average(bool, default False) –The face to face side to side joints rotated joint as average.
-
face_to_face_side_to_side_joints_dihedral_angle(float, default 150.0) –The face to face side to side joints dihedral angle.
-
limit_min_joint_length(float, default 0.0) –The limit min joint length.
-
existing_types((list[str], read - only)) –The existing types of joints.
-
joints_parameters_and_types(list[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_male(list[Polyline], default []) –Joinery polylines for custom side-to-side edge in-plane male joints.
-
custom_joints_ss_e_ip_female(list[Polyline], default []) –Joinery polylines for custom side-to-side edge in-plane female joints.
-
custom_joints_ss_e_op_male(list[Polyline], default []) –Joinery polylines for custom side-to-side edge out-of-plane male joints.
-
custom_joints_ss_e_op_female(list[Polyline], default []) –Joinery polylines for custom side-to-side edge out-of-plane female joints.
-
custom_joints_ts_e_p_male(list[Polyline], default []) –Joinery polylines for custom top-to-side edge in-plane male joints.
-
custom_joints_ts_e_p_female(list[Polyline], default []) –Joinery polylines for custom top-to-side edge in-plane female joints.
-
custom_joints_cr_c_ip_male(list[Polyline], default []) –Joinery polylines for custom corner-to-corner in-plane male joints.
-
custom_joints_cr_c_ip_female(list[Polyline], default []) –Joinery polylines for custom corner-to-corner in-plane female joints.
-
custom_joints_tt_e_p_male(list[Polyline], default []) –Joinery polylines for custom top-to-top edge in-plane male joints.
-
custom_joints_tt_e_p_female(list[Polyline], default []) –Joinery polylines for custom top-to-top edge in-plane female joints.
-
custom_joints_ss_e_r_male(list[Polyline], default []) –Joinery polylines for custom side-to-side edge rounded male joints.
-
custom_joints_ss_e_r_female(list[Polyline], default []) –Joinery polylines for custom side-to-side edge rounded female joints.
-
custom_joints_b_male(list[Polyline], default []) –Joinery polylines for custom base male joints.
-
custom_joints_b_female(list[Polyline], default []) –Joinery polylines for custom base female joints.
Functions¤
beam_skeleton
¤
beam_skeleton(mesh: Mesh, divisions=10, number_of_neighbours=10, extend_ends=True) -> tuple[Polyline, list[float]]
Get central axis of a mesh whose geometry is closed to a beam.
Parameters:
-
mesh(:class:`compas.datastructures.Mesh`) –The mesh to get the central axis from.
-
divisions(int, default:10) –Central axis is subdivded in this number of points.
-
number_of_neighbours(int, default:10) –The distance value for each polyline point is calculated based on the average distance to this number of neighbours.
-
extend_ends(bool, default:True) –Whether to extend the ends of the central axis to the mesh using Ray-Mesh Intersection.
Returns:
-
tuple[ :class:`compas.geometry.Polyline`, list[float]]–The central axis of the beam and the distances of the points to the mesh.
closed_mesh_from_polylines
¤
get_connection_zones
¤
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=[], remove_duplicate_polylines=False)
Get connection zones for the given input parameters.
Parameters:
-
input_polyline_pairs(list[list[Polyline]]) –List of polylines that represents the timber elements.
-
input_insertion_vectors(list[Vector], default:[]) –List of insertion vectors.
-
input_joint_types(list[int], default:[]) –List of joint types.
-
input_three_valence_element_indices_and_instruction(list[int], default:[]) –List of three valence element indices and instruction.
-
input_adjacency(list[int], default:[]) –List of adjacency.
-
input_joint_parameters_and_types(list[float], default:[]) –List of joint parameters and types.
-
input_search_type(int, default:0) –Search type.
-
input_scale(list[float], default:[1, 1, 1]) –Scale.
-
input_output_type(int, default:3) –Output type.
-
input_joint_volume_parameters(list[float], default:[0, 0, 0]) –Joint volume parameters.
-
input_face_to_face_side_to_side_joints_all_treated_as_rotated(bool) –Face to face side to side joints all treated as rotated.
-
input_custom_joints(list[Point], default:[]) –Custom joints.
-
input_custom_joints_types(list[int], default:[]) –Custom joints types.
-
remove_duplicate_polylines(bool, default:False) –Remove duplicate polylines.
Returns:
joints
¤
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_pairs(list[list[Polyline]]) –List of polylines that represents the timber elements.
-
search_type(int, default:0) –Search type.
Returns:
mesh_boolean_difference_from_polylines
¤
The polylines lists first items represnts elements outlines and the second items represents joinery outlines.
Parameters:
-
polylines_lists(list 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.
mesh_skeleton
¤
Get the skeleton of a mesh.
Parameters:
-
mesh(:class:`compas.datastructures.Mesh`) –The mesh to get the skeleton from.
Returns:
-
list[ :class:`compas.geometry.Polyline`]–The skeleton of the mesh.
read_xml_polylines
¤
read_xml_polylines_and_properties
¤
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)
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:
-
foldername(str, default:'/home/petras/brg/2_code/wood_nano/src/wood/cmake/src/wood/dataset/') –Foldername.
-
filename_of_dataset(str, default:'type_plates_name_top_to_side_and_side_to_side_outofplane_annen_grid_small') –Filename of dataset.
-
scale(float, default:0.01) –Scale.
Returns:
rtree
¤
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:
Returns: