kumiki.construction¶
Flat import path
kumiki/__init__.py re-exports everything on this page via from kumiki import *, so every name below is also available directly as kumiki.StickoutReference -- you do not need to import from the submodule path shown in the heading above.
kumiki.construction
¶
Kumiki - Timber construction functions Contains functions for creating and manipulating timbers
StickoutReference
¶
Bases: Enum
Defines how stickout is measured relative to timber connection points.
Stickout measured from centerline of the timber (default)
joined timber | | |||===== created timber | |
Stickout measured from inside face of the timber
joined timber | | | |===== created timber | |
Stickout measured from outside face of the timber
joined timber | | |====== created timber | |
Stickout
¶
Defines how much a timber extends beyond connection points.
For symmetric stickout, set stickout1 = stickout2. For asymmetric stickout, use different values. Default is no stickout (0, 0) from CENTER_LINE.
StickoutReference modes:
Stickout measured from centerline of the joined timber
joined timber | | |||===== created timber | |
Stickout measured from inside face of the joined timber
joined timber | | | |===== created timber | |
Stickout measured from outside face of the joined timber
joined timber | | |====== created timber | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stickout1
|
Extension beyond the first connection point (default: 0) |
required | |
stickout2
|
Extension beyond the second connection point (default: 0) |
required | |
stickoutReference1
|
How stickout1 is measured (default: CENTER_LINE) |
required | |
stickoutReference2
|
How stickout2 is measured (default: CENTER_LINE) |
required |
Examples:
Symmetric stickout from centerline¶
s = Stickout.symmetric(scalar(1, 5)) # Both sides extend 0.2m from centerline
No stickout¶
s = Stickout.nostickout() # Both sides are 0
Asymmetric stickout¶
s = Stickout(scalar(1, 10), scalar(2, 5)) # Left extends 0.1m, right extends 0.4m from centerline
Stickout from outside faces¶
s = Stickout(scalar(1, 10), scalar(1, 5), StickoutReference.OUTSIDE, StickoutReference.OUTSIDE)
stickoutReference1
class-attribute
instance-attribute
¶
stickoutReference1: Optional[StickoutReference] = None
stickoutReference2
class-attribute
instance-attribute
¶
stickoutReference2: Optional[StickoutReference] = None
__post_init__
¶
Set default stickout references if not provided.
Source code in kumiki/construction.py
symmetric
classmethod
¶
symmetric(value: Numeric, reference: Optional[StickoutReference] = None) -> Stickout
Create a symmetric stickout where both sides extend by the same amount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Numeric
|
The stickout distance for both sides |
required |
reference
|
Optional[StickoutReference]
|
How stickout is measured (default: CENTER_LINE) |
None
|
Returns:
| Type | Description |
|---|---|
Stickout
|
Stickout instance with stickout1 = stickout2 = value |
Source code in kumiki/construction.py
ArrangementNames
¶
Bases: Enum
identifies each of the timbers in the various arrangements, we just use one enum for convenience but we really only want to refer to timbers specific to a certain arrangement when using this class
ButtJointTimberArrangement
¶
front_face_on_butt_timber
class-attribute
instance-attribute
¶
front_face_on_butt_timber: Optional[TimberLongFace] = None
top_face_on_butt_timber
class-attribute
instance-attribute
¶
top_face_on_butt_timber: Optional[TimberLongFace] = None
compute_normalized_timber_cross_product
¶
compute_normalized_timber_cross_product() -> Direction3D
Compute the normalized cross product of the butt timber and receiving timber length directions.
Source code in kumiki/construction.py
compute_arrangement_acute_angle
¶
compute_arrangement_acute_angle() -> Numeric
Compute the angle between the 2 timbers
Source code in kumiki/construction.py
check_plane_aligned
¶
Return None if timbers are plane-aligned and front/top face are in plane, else an error message.
Source code in kumiki/construction.py
check_face_aligned_and_orthogonal
¶
Return None if timbers are face-aligned, else an error message.
Unlike check_plane_aligned, this does not validate front_face_on_butt_timber: callers that use this (e.g. drop-in dovetail/housed butt joints) already apply their own, looser front-face validation suited to non-coplanar orthogonal arrangements.
Source code in kumiki/construction.py
check_perfection
¶
Return None if both timbers are perfect, else an error message.
Source code in kumiki/construction.py
DoubleButtJointTimberArrangement
¶
Two butt timbers meeting a single receiving timber.
Arrangements: - Opposing: butt_timber_1 and butt_timber_2 point in opposite cardinal directions (antiparallel, like spokes from either side of the receiving timber). - Orthogonal: butt_timber_1 and butt_timber_2 point in perpendicular cardinal directions (90° apart, like an L at the receiving timber).
front_face_on_butt_timber_1
class-attribute
instance-attribute
¶
front_face_on_butt_timber_1: Optional[TimberLongFace] = None
check_face_aligned
¶
Return None if all timbers are face-aligned with the receiving timber, else an error message.
Source code in kumiki/construction.py
check_face_aligned_cardinal_and_opposing_butts
¶
Return None if: - all timbers are face-aligned, - each butt timber's length direction is orthogonal to the receiving timber (cardinal), - butt_timber_1 and butt_timber_2 are in different cardinal directions, and - the pair approaches from opposite directions (antiparallel), accounting for which end of each timber is used.
Source code in kumiki/construction.py
check_face_aligned_and_orthogonal_butts
¶
Return None if all timbers are face-aligned and the two butt timbers are orthogonal to each other (length directions perpendicular), else an error message.
Source code in kumiki/construction.py
check_perfection
¶
Return None if all timbers are perfect, else an error message.
Source code in kumiki/construction.py
TripleButtJointTimberArrangement
¶
Three butt timbers meeting a single receiving timber.
main_butt_timber_1 and main_butt_timber_2 form an opposing pair (antiparallel). awk_timber is the third butt timber pointing in a third cardinal direction.
check_face_aligned
¶
Return None if all butt timbers are face-aligned with the receiving timber, else an error message.
Source code in kumiki/construction.py
check_face_aligned_cardinal_and_opposing_butts
¶
Return None if: - all timbers are face-aligned, - each butt timber's length direction is orthogonal to the receiving timber (cardinal), - all three butt timbers are in different cardinal directions, and - main_butt_timber_1 and main_butt_timber_2 are antiparallel (pointing towards each other).
Source code in kumiki/construction.py
check_perfection
¶
Return None if all timbers are perfect, else an error message.
Source code in kumiki/construction.py
QuadrupleButtJointTimberArrangement
¶
Four butt timbers meeting a single receiving timber, covering all four cardinal directions.
main_butt_timber_1 and main_butt_timber_2 form one opposing pair (antiparallel). awk_1 and awk_2 form the second opposing pair (antiparallel, on the perpendicular axis).
check_face_aligned
¶
Return None if all butt timbers are face-aligned with the receiving timber, else an error message.
Source code in kumiki/construction.py
check_face_aligned_cardinal_and_opposing_butts
¶
Return None if: - all timbers are face-aligned, - each butt timber's length direction is orthogonal to the receiving timber (cardinal), - all four butt timbers are in different cardinal directions, and - main_butt_timber_1/main_butt_timber_2 are antiparallel and awk_1/awk_2 are antiparallel.
Source code in kumiki/construction.py
check_perfection
¶
Return None if all timbers are perfect, else an error message.
Source code in kumiki/construction.py
CrossCapJointTimberArrangement
¶
A butting post timber "capped" by two crossed timbers.
check_face_aligned_and_orthogonal
¶
Source code in kumiki/construction.py
check_perfection
¶
Return None if all timbers are perfect, else an error message.
Source code in kumiki/construction.py
SpliceJointTimberArrangement
¶
front_face_on_timber1
class-attribute
instance-attribute
¶
front_face_on_timber1: Optional[TimberLongFace] = None
check_face_aligned_and_parallel_axis
¶
Return None if timbers are face-aligned and have parallel length axes, else an error message.
Source code in kumiki/construction.py
check_perfection
¶
Return None if both timbers are perfect, else an error message.
Source code in kumiki/construction.py
CornerJointTimberArrangement
¶
front_face_on_timber1
class-attribute
instance-attribute
¶
front_face_on_timber1: Optional[TimberLongFace] = None
compute_normalized_timber_cross_product
¶
compute_normalized_timber_cross_product() -> Direction3D
Compute the normalized cross product of timber1 and timber2 length directions.
Source code in kumiki/construction.py
is_timber2_left_of_timber1
¶
returns true if timber2 is to the left of timber1 when looking down the length of timber1 and standing on the front face of timber1
Source code in kumiki/construction.py
check_plane_aligned
¶
Return None if timbers are plane-aligned and front face is in plane, else an error message.
Source code in kumiki/construction.py
check_face_aligned_and_orthogonal
¶
Return None if timbers are face-aligned and orthogonal, else an error message.
Source code in kumiki/construction.py
check_perfection
¶
Return None if both timbers are perfect, else an error message.
Source code in kumiki/construction.py
CrossJointTimberArrangement
¶
front_face_on_timber1
class-attribute
instance-attribute
¶
front_face_on_timber1: Optional[TimberLongFace] = None
compute_normalized_timber_cross_product
¶
compute_normalized_timber_cross_product() -> Direction3D
Compute the normalized cross product of timber1 and timber2 length directions.
Source code in kumiki/construction.py
check_plane_aligned
¶
Return None if timbers are plane-aligned and front face is in plane, else an error message.
Source code in kumiki/construction.py
check_face_aligned_and_orthogonal
¶
Return None if timbers are face-aligned and orthogonal, else an error message.
Source code in kumiki/construction.py
check_perfection
¶
Return None if both timbers are perfect, else an error message.
Source code in kumiki/construction.py
BraceJointTimberArrangement
¶
front_face_on_timber1
class-attribute
instance-attribute
¶
front_face_on_timber1: Optional[TimberLongFace] = None
check_perfection
¶
Return None if all timbers are perfect, else an error message.
Source code in kumiki/construction.py
ButtJointBoardArrangement
¶
front_face_on_butt_timber
class-attribute
instance-attribute
¶
front_face_on_butt_timber: Optional[TimberFace] = None
__post_init__
¶
check_orthogonal
¶
Return None if timbers are orthogonal, else an error message. Timbers are orthogonal in this arrangement if butt_timber_face is parallel to some face on the receiving_timber
Source code in kumiki/construction.py
check_face_aligned
¶
Return None if timbers are face-aligned, else an error message.
Source code in kumiki/construction.py
check_perfection
¶
Return None if both timbers are perfect, else an error message.
Source code in kumiki/construction.py
PanelBoardArrangement
¶
check_parallal_coplanar_and_same_thickness
¶
Return None if all boards are parallel (same orientation), share the same thickness, and are coplanar (all measured against boards[0]), else an error message describing the first violation found.
Source code in kumiki/construction.py
ExtendedTimberArrangement
¶
Just a list of timbers, with no real restriction until check functions are called...
check_plane_aligned
¶
check_parallel
¶
Return None if all timbers have parallel length directions (measured against timbers[0]), else an error message.
Source code in kumiki/construction.py
check_face_aligned
¶
Return None if all timbers are face-aligned (measured against timbers[0]), else an error message.
Source code in kumiki/construction.py
check_coaxial_face_aligned_and_same_size
¶
Return None if all timbers share the same centerline (coaxial), are face-aligned, and have the same cross-sectional size, else an error message describing the first violation found (measured against timbers[0]).
"Same size" is checked along matching GLOBAL directions rather than local (width, height) indices: a face-aligned timber may be rotated 90 degrees about the shared centerline relative to timbers[0], in which case its local width/height are swapped relative to global space even though its physical cross-section matches.
Source code in kumiki/construction.py
create_axis_aligned_timber
¶
create_axis_aligned_timber(bottom_position: V3, length: Numeric, size: V2, length_direction: TimberFace, width_direction: Optional[TimberFace] = None, ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Creates an axis-aligned timber using TimberFace to reference directions in the world coordinate system.
AGENT NOTE: Prefer methods like join_timber, attach_face/plane_aligned_timber, create_*_timber_on_footprint, which are more robust and easier to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bottom_position
|
V3
|
Position of the bottom point of the timber |
required |
length
|
Numeric
|
Length of the timber |
required |
size
|
V2
|
Cross-sectional size (width, height) |
required |
length_direction
|
TimberFace
|
Direction for the timber's length axis |
required |
width_direction
|
Optional[TimberFace]
|
Optional direction for the timber's width axis. If not provided, defaults to RIGHT (+X) unless length_direction is RIGHT, in which case TOP (+Z) is used. |
None
|
ticket
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for this timber (can be Ticket object or string name, used for rendering/debugging) |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
New timber with the specified axis-aligned orientation |
Source code in kumiki/construction.py
create_vertical_timber_on_footprint_corner
¶
create_vertical_timber_on_footprint_corner(footprint: Footprint, corner_index: int, length: Numeric, location_type: FootprintLocation, size: V2, ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Creates a vertical timber (post) on a footprint boundary corner.
The post is positioned on an orthogonal boundary corner (where two boundary sides are perpendicular) according to the location type:
Location types: - INSIDE: Post has one vertex of bottom face on the boundary corner, with 2 edges aligned with the 2 boundary sides, post extends inside the boundary - OUTSIDE: Post positioned with opposite vertex on the boundary corner, extends outside - CENTER: Post center is on the boundary corner, with 2 edges parallel to boundary sides
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
footprint
|
Footprint
|
The footprint to place the timber on |
required |
corner_index
|
int
|
Index of the boundary corner |
required |
length
|
Numeric
|
Length of the vertical timber (height) |
required |
location_type
|
FootprintLocation
|
Where to position the timber relative to the boundary corner |
required |
size
|
V2
|
Timber size (width, depth) as a 2D vector |
required |
ticket
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for this timber (can be Ticket object or string name, used for rendering/debugging) |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
Timber positioned vertically on the footprint boundary corner |
Source code in kumiki/construction.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
create_vertical_timber_on_footprint_side
¶
create_vertical_timber_on_footprint_side(footprint: Footprint, side_index: int, distance_along_side: Numeric, length: Numeric, location_type: FootprintLocation, size: V2, ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Creates a vertical timber (post) positioned at a point along a footprint boundary side.
The post is placed at a specified distance along the boundary side from the starting corner.
Location types: - INSIDE: One edge of bottom face lies on boundary side, center of edge at the point, post extends inside - OUTSIDE: One edge of bottom face lies on boundary side, center of edge at the point, post extends outside - CENTER: Center of bottom face is on the point, 2 edges of bottom face parallel to boundary side
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
footprint
|
Footprint
|
The footprint to place the timber on |
required |
side_index
|
int
|
Index of the boundary side (from corner[side_index] to corner[side_index+1]) |
required |
distance_along_side
|
Numeric
|
Distance from the starting corner along the side (0 = at start corner) |
required |
length
|
Numeric
|
Length of the vertical timber (height) |
required |
location_type
|
FootprintLocation
|
Where to position the timber relative to the boundary side |
required |
size
|
V2
|
Timber size (width, depth) as a 2D vector |
required |
ticket
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for this timber (can be Ticket object or string name, used for rendering/debugging) |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
Timber positioned vertically at the specified point on the footprint boundary side |
Source code in kumiki/construction.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
create_horizontal_timber_on_footprint
¶
create_horizontal_timber_on_footprint(footprint: Footprint, corner_index: int, location_type: FootprintLocation, size: V2, length: Optional[Numeric] = None, ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Creates a horizontal timber (mudsill) on the footprint boundary side.
The mudsill runs from corner_index to corner_index + 1 along the boundary side. With the face ends of the mudsill timber starting/ending on the footprint corners.
Location types: - INSIDE: One edge of the timber lies on the boundary side, timber is on the inside - OUTSIDE: One edge of the timber lies on the boundary side, timber is on the outside - CENTER: The centerline of the timber lies on the boundary side
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
footprint
|
Footprint
|
The footprint to place the timber on |
required |
corner_index
|
int
|
Index of the starting boundary corner |
required |
location_type
|
FootprintLocation
|
Where to position the timber relative to the boundary side |
required |
size
|
V2
|
Timber size (width, height) as a 2D vector |
required |
length
|
Optional[Numeric]
|
Length of the timber (optional; if not provided, uses boundary side length) |
None
|
ticket
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for this timber (can be Ticket object or string name, used for rendering/debugging) |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
Timber positioned on the footprint boundary side |
Source code in kumiki/construction.py
stretch_timber
¶
stretch_timber(timber: Timber, end: TimberEnd, overlap_length: Numeric, extend_length: Numeric) -> Timber
Creates a new timber extending the original timber by a given length.
The original timber is conceptually discarded and replaced with a new timber that is the original timber plus the extension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
end
|
TimberEnd
|
The end of the timber to extend |
required |
overlap_length
|
Numeric
|
Length of timber to overlap with existing timber |
required |
extend_length
|
Numeric
|
Length of timber to extend beyond the end of the original timber (does not include the overlap length) |
required |
Source code in kumiki/construction.py
split_timber
¶
split_timber(timber: Timber, distance_from_bottom: Numeric, ticket1: Optional[Union[TimberTicket, str]] = None, ticket2: Optional[Union[TimberTicket, str]] = None) -> Tuple[Timber, Timber]
Split a timber into two timbers at the specified distance from the bottom.
The original timber is conceptually discarded and replaced with two new timbers: - The first timber extends from the original bottom to the split point - The second timber extends from the split point to the original top
Both timbers maintain the same cross-sectional size and orientation as the original. You will often follow this with a splice joint to join the two timbers together.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timber
|
Timber
|
The timber to split |
required |
distance_from_bottom
|
Numeric
|
Distance along the timber's length where to split (0 < distance < timber.length) |
required |
ticket1
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for the bottom timber (defaults to "{original_name}_bottom") |
None
|
ticket2
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for the top timber (defaults to "{original_name}_top") |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
Tuple of (bottom_timber, top_timber) where: |
Timber
|
|
Tuple[Timber, Timber]
|
|
Example
If a timber has length 10 and is split at distance 3: - bottom_timber has length 3, same origin as original - top_timber has length 7, origin at distance 3 from original origin
Source code in kumiki/construction.py
attach_timber
¶
attach_timber(original_timber: TimberLike, size: V2, attached_timber_direction: Direction3D, attached_timber_length: Numeric, attached_timber_opposite_length: Numeric = scalar(0), attached_timber_width_direction: Optional[Direction3D] = None, attached_timber_end_that_points_towards_original_timber: TimberEnd = BOTTOM, original_timber_end_to_measure_from_for_length_position: TimberEnd = BOTTOM, length_position_measurement: Numeric = scalar(0), lateral_offset: Numeric = scalar(0), ticket: Optional[Union[TimberTicket, str]] = None)
NOTE this function is perhaps not so useful in practice, it's mainly here for completeness. Perhaps there are some cases where it's a better alternative to create_timber
Creates a timber that is attached to original_timber.
The original timber is referred to as "original_timber" and the new timber as "attached_timber".
Positioning¶
The attached timber's attached_timber_end_that_points_towards_original_timber end position is length_position_measurement away from
original_timber_end_to_measure_from_for_length_position and then lateral_offset away from the centerline of the original timber,
measured in the direction
length axis of the original timber CROSS length axis of the created attached timber
Orientation¶
The attached timber's orientation is such that its length axis is in the attached_timber_direction direction
and its right face best aligns with attached_timber_right_direction.
if attached_timber_right_direction is None then the direction of the TOP face of the original timber is used instead.
Returns:
| Type | Description |
|---|---|
|
The new attached timber, face-aligned with and positioned relative to the original timber. |
Source code in kumiki/construction.py
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | |
attach_plane_aligned_timber
¶
attach_plane_aligned_timber(original_timber: TimberLike, size: V2, original_timber_long_face_that_attached_timber_points_to: TimberLongFace, attached_timber_angle: Numeric, attached_timber_length_or_target: Union[Numeric, TimberLike], attached_timber_stickout: Stickout = nostickout(), attached_timber_end_that_points_towards_original_timber: TimberEnd = BOTTOM, original_timber_end_to_measure_from_for_length_position: TimberEnd = BOTTOM, attached_timber_long_face_to_measure_to_for_length_position: Union[TimberLongFace, TimberCenterline] = CENTERLINE, length_position_measurement: Numeric = scalar(0), original_timber_face_to_measure_from_for_lateral_position: Union[TimberFace, TimberCenterline] = CENTERLINE, attached_timber_long_face_to_measure_to_for_lateral_position: Union[TimberLongFace, TimberCenterline] = CENTERLINE, lateral_position_measurement: Numeric = scalar(0), ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Creates a timber that is plane-aligned with and attached to original_timber at an angle.
Generalizes :func:attach_face_aligned_timber: the attached timber's length axis lies in the
plane spanned by the original timber's length axis and the normal of
original_timber_long_face_that_attached_timber_points_to (the face it points out of), making
an angle of attached_timber_angle with the original timber's length axis. The attached
timber stays plane-aligned with the original (two of its long faces remain parallel to the
original's lateral faces). attach_face_aligned_timber is the attached_timber_angle == pi/2
(perpendicular) case.
attached_timber_end_that_points_towards_original_timber chooses which end of the attached
timber sits on the original-timber side; note that this flips the realized angle to
pi - attached_timber_angle.
Extents¶
attached_timber_length_or_target places the target end (the end pointing away from the
original timber):
- a numeric length extends the timber along its (tilted) length axis, measured from the
original timber's centerline.
- a timber extends the attached timber until its centerline just touches the target timber's
reference feature selected by attached_timber_stickout.stickoutReference2, taken on the
target's silhouette projected onto the plane spanned by the original timber's length axis
and the attach direction: its CENTER_LINE, or the near (INSIDE) / far (OUTSIDE) boundary of
the silhouette (for a target plane-aligned with that plane these are its long faces; for a
rotated target, its projected corner edges). If the target's centerline is parallel to the
lateral axis it projects to a single point, which is dropped perpendicularly onto the
attached timber's length axis. stickout2 then extends the target end beyond that
feature. stickout2 is ignored (with a warning if set) when a numeric length is given
instead.
attached_timber_stickout places the start end (the end that attaches to the original
timber): the start end is where the attached timber's centerline just touches the original
timber's feature selected by stickoutReference1 — its CENTER_LINE (default), the INSIDE
face (the face the attached timber points out of), or the OUTSIDE face (the opposite face) —
extended by stickout1 beyond it.
Everything else follows attach_face_aligned_timber:
- the length-position is measured along the original timber's length axis from
original_timber_end_to_measure_from_for_length_position to
attached_timber_long_face_to_measure_to_for_length_position (or orthogonally to its centerline).
- the lateral-position is measured along the lateral axis from
original_timber_face_to_measure_from_for_lateral_position to
attached_timber_long_face_to_measure_to_for_lateral_position (or orthogonally to its centerline).
All measurements are taken from the perfect timber within of the original and attached timber.
original_timber_long_face_that_attached_timber_points_to chosen on the wrong side (e.g. the
target actually lies opposite the face's outward normal) would otherwise solve for a
non-positive attached timber length. Rather than failing in that case, this automatically
retries with the opposite long face (RIGHT<->LEFT or FRONT<->BACK) and, if that succeeds,
emits a warning and uses it instead. Only fails if BOTH the requested face and its opposite
produce a non-positive length.
Returns:
| Type | Description |
|---|---|
Timber
|
The new attached timber, plane-aligned with and positioned relative to the original timber. |
Source code in kumiki/construction.py
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 | |
attach_face_aligned_timber
¶
attach_face_aligned_timber(original_timber: TimberLike, size: V2, original_timber_long_face_that_attached_timber_points_to: TimberLongFace, attached_timber_length_or_target: Union[Numeric, TimberLike], attached_timber_stickout: Stickout = nostickout(), attached_timber_end_that_points_towards_original_timber: TimberEnd = BOTTOM, original_timber_end_to_measure_from_for_length_position: TimberEnd = BOTTOM, attached_timber_long_face_to_measure_to_for_length_position: Union[TimberLongFace, TimberCenterline] = CENTERLINE, length_position_measurement: Numeric = scalar(0), original_timber_face_to_measure_from_for_lateral_position: Union[TimberFace, TimberCenterline] = CENTERLINE, attached_timber_long_face_to_measure_to_for_lateral_position: Union[TimberLongFace, TimberCenterline] = CENTERLINE, lateral_position_measurement: Numeric = scalar(0), ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Creates a timber that is face-aligned with and attached to original_timber.
The original timber is referred to as "original_timber" and the new timber as "attached_timber". The attached timber runs perpendicular to the chosen long face of the original timber and is fully face-aligned with it.
All measurements are taken from the perfect timber within of the original and attached timber
Orientation¶
The attached timber's length axis runs along the normal of
original_timber_long_face_that_attached_timber_points_to (the face it "points to" / sticks
out of). attached_timber_end_that_points_towards_original_timber chooses which end
(TOP/BOTTOM) of the attached timber sits on the original-timber side. If the chosen face turns
out to be on the wrong side of the target, this automatically retries with its opposite long
face instead of failing -- see :func:attach_plane_aligned_timber.
The attached timber's height and width axis orientation are determined by: - attached_timber_long_face_to_measure_to_for_lateral_position - attached_timber_long_face_to_measure_to_for_length_position so that these faces are parallel to the features on original_timber that they are measured from.
Extents¶
attached_timber_length_or_target places the far end of the attached timber: either a
numeric length measured from the original timber's centerline, or a timber to extend to (up
to the feature selected by attached_timber_stickout.stickoutReference2, plus
stickout2 beyond it). attached_timber_stickout places the near end relative to the
original timber's feature selected by stickoutReference1 (CENTER_LINE by default),
extended by stickout1 beyond it. See :func:attach_plane_aligned_timber for details.
Positioning¶
The attached timber's position is such that the distance between
original_timber_end_to_measure_from_for_length_position and attached_timber_long_face_to_measure_to_for_length_position
is length_position_measurement,
and the distance between
original_timber_face_to_measure_from_for_lateral_position and attached_timber_long_face_to_measure_to_for_lateral_position
is lateral_position_measurement.
Returns:
| Type | Description |
|---|---|
Timber
|
The new attached timber, face-aligned with and positioned relative to the original timber. |
Source code in kumiki/construction.py
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 | |
join_timbers
¶
join_timbers(timber1: PerfectTimberWithin, timber2: PerfectTimberWithin, location_on_timber1: Numeric, location_on_timber2: Optional[Numeric] = None, lateral_offset: Numeric = scalar(0), stickout: Stickout = nostickout(), size: Optional[V2] = None, orientation_width_vector: Optional[Direction3D] = None, ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Joins two timbers by creating a connecting timber from centerline to centerline.
This function creates a timber that connects the centerline of timber1 to the centerline of timber2. The joining timber's length direction goes from timber1 to timber2, and its position can be laterally offset from this centerline-to-centerline path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timber1
|
PerfectTimberWithin
|
First timber to join (start point) |
required |
timber2
|
PerfectTimberWithin
|
Second timber to join (end point) |
required |
location_on_timber1
|
Numeric
|
Position along timber1's length where the joining timber starts |
required |
location_on_timber2
|
Optional[Numeric]
|
Optional position along timber2's length where the joining timber ends. If not provided, uses the same Z-height as location_on_timber1. |
None
|
lateral_offset
|
Numeric
|
Lateral offset of the joining timber perpendicular to the direct centerline-to-centerline path. The offset direction is determined by the cross product of timber1's length direction and the joining direction. Defaults to scalar(0) (no offset). |
scalar(0)
|
stickout
|
Stickout
|
How much the joining timber extends beyond each connection point (both sides). Always measured from centerlines in this function. Defaults to Stickout.nostickout() if not provided. |
nostickout()
|
size
|
Optional[V2]
|
Optional size (width, height) of the joining timber. If not provided, determined from timber1's size based on orientation. |
None
|
orientation_width_vector
|
Optional[Direction3D]
|
Optional width direction hint for the created timber in global space. Will be automatically projected onto the normal plane of the length axis of the created timber. This is useful for specifying orientation like "face up" for rafters. If not provided, uses timber1's length direction projected onto the perpendicular plane. If the provided vector is parallel to the joining direction, falls back to timber1's width direction. |
None
|
ticket
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for this timber (can be Ticket object or string name, used for rendering/debugging) |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
New timber connecting timber1 and timber2 along their centerlines |
Source code in kumiki/construction.py
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 | |
join_plane_aligned_on_plane_aligned_timbers
¶
join_plane_aligned_on_plane_aligned_timbers(timber1: PerfectTimberWithin, timber2: PerfectTimberWithin, location_on_timber1: Numeric, location_on_timber2: Numeric, stickout: Stickout, size: V2, lateral_offset_from_timber1: Numeric = scalar(0), feature_to_mark_on_joining_timber: Optional[TimberFeature] = None, orientation_long_face_on_timber1: Optional[TimberLongFace] = None, orientation_long_face_on_timber2: Optional[TimberLongFace] = RIGHT, ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Joins two plane-aligned timbers with a connecting timber that lies in their shared plane.
Deprecated: This function's own signature is the main reason for the deprecation --
the lateral-offset/feature-marking/orientation-long-face parameters are hard to reason
about together. attach_plane_aligned_timber covers the same cases with a signature
that, while still not simple, is a bit easier to follow. Prefer it for new code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timber1
|
PerfectTimberWithin
|
First timber to join |
required |
timber2
|
PerfectTimberWithin
|
Second timber to join (plane-aligned with timber1) |
required |
location_on_timber1
|
Numeric
|
Position along timber1's length where the joining timber attaches |
required |
location_on_timber2
|
Numeric
|
Position along timber2's length where the joining timber attaches |
required |
stickout
|
Stickout
|
How much the joining timber extends beyond each connection point |
required |
size
|
V2
|
Cross-sectional size (width, height) of the joining timber |
required |
lateral_offset_from_timber1
|
Numeric
|
Lateral offset, in the axis perpendicular to the shared plane, from feature_to_mark_on_joining_timber. Defaults to scalar(0). |
scalar(0)
|
feature_to_mark_on_joining_timber
|
Optional[TimberFeature]
|
Optional feature on the created timber to use as the reference for the lateral offset. It is intended for you to use the locate_face or locate_long_edge functions to create a plane or line on a timber. If not provided, uses the centerline. If a plane is provided, the "origin" of the plane is used for longitudinal positioning (i.e. location_on_timber1). In the case of locate_face, the origin aligns with the center of the created timber. |
None
|
orientation_long_face_on_timber1
|
Optional[TimberLongFace]
|
Optional long face of timber1, on the shared plane, to orient against. If None, an arbitrary face of timber1 on the shared plane is used. |
None
|
orientation_long_face_on_timber2
|
Optional[TimberLongFace]
|
The long face on the created timber that will align with orientation_long_face_on_timber1. Defaults to TimberLongFace.RIGHT. |
RIGHT
|
ticket
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for this timber (can be Ticket object or string name, used for rendering/debugging) |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
New timber that joins timber1 and timber2, lying in their shared plane |
Source code in kumiki/construction.py
1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 | |
join_face_aligned_on_face_aligned_timbers
¶
join_face_aligned_on_face_aligned_timbers(timber1: PerfectTimberWithin, timber2: PerfectTimberWithin, location_on_timber1: Numeric, stickout: Stickout, size: V2, lateral_offset_from_timber1: Numeric = scalar(0), feature_to_mark_on_joining_timber: Optional[TimberFeature] = None, orientation_face_on_timber1: Optional[TimberFace] = None, ticket: Optional[Union[TimberTicket, str]] = None) -> Timber
Joins two face-aligned timbers with a perpendicular timber.
Deprecated: This function's own signature is the main reason for the deprecation --
the lateral-offset/feature-marking/orientation-face parameters are hard to reason
about together. attach_face_aligned_timber covers the same cases with a signature
that, while still not simple, is a bit easier to follow. Prefer it for new code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timber1
|
PerfectTimberWithin
|
First timber to join |
required |
timber2
|
PerfectTimberWithin
|
Second timber to join (face-aligned with timber1) |
required |
location_on_timber1
|
Numeric
|
Position along timber1's length where the joining timber attaches |
required |
stickout
|
Stickout
|
How much the joining timber extends beyond each connection point |
required |
size
|
V2
|
Cross-sectional size (width, height) of the joining timber |
required |
lateral_offset_from_timber1
|
Numeric
|
Lateral offset from timber1's centerline reference. Defaults to scalar(0). |
scalar(0)
|
feature_to_mark_on_joining_timber
|
Optional[TimberFeature]
|
Optional feature on the create timber to use as the reference for the lateral offset. It is intended for you to use the locate_face or locate_long_edge functions to create a plane or line on a timber. If not provided, uses the centerline. If a plane is provided, the "origin" of the plane is used for longitudinal positioning (i.e. location_on_timber1). In the case of locate_face, the origin aligns with the center of the created timber. |
None
|
orientation_face_on_timber1
|
Optional[TimberFace]
|
Optional face of timber1 to orient against. If provided, the width direction of the created timber will align with this face on timber1. If not provided, uses timber1's length direction projected onto the perpendicular plane. |
None
|
ticket
|
Optional[Union[TimberTicket, str]]
|
Optional ticket for this timber (can be Ticket object or string name, used for rendering/debugging) |
None
|
Returns:
| Type | Description |
|---|---|
Timber
|
New timber that joins timber1 and timber2 |
Source code in kumiki/construction.py
1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 | |