Skip to content

Latest commit

 

History

History
86 lines (67 loc) · 3.61 KB

File metadata and controls

86 lines (67 loc) · 3.61 KB
title chamfer
description Bevel selected edges of a solid by a constant distance.
sourceReview
packageVersion sources
0.0.1-alpha.16
path sha256
packages/core/src/library/runtime.ts
dcee3d2388a9b7b3819bb4897edd894463daa0e5b519e832a3349fac98c3bff8
path sha256 commit
packages/core/src/library/topology.ts
f9f0d048fe30cc80046a25123aa8101ca51e85cdb5b2e66260c6a68f43f84715
67228dd8559d584852df7bfbd47ed89f1d8003e9
path sha256 commit
packages/core/src/library/topology-id.ts
49b2812aa89e5a886759166c89e32cf01a629fe888bcc57452ede2feeba7dc01
904463d8c4405f4a2b1c073ba9a5edc997732e23
path sha256 commit
packages/core/src/library/validation.ts
dae9300aea522c8aee83ef09e6716f31cd17f0cf6fb6df537218ecb72c63419d
69d231fb775befdb3cd098291b4097ccd52d8966
sidebar
hidden
true
head
tag content
title
chamfer — Code3D TypeScript API reference

Bevel selected edges of a solid by a constant distance.

Example

import {box} from '@code3d/core';

export const beveled = box(30, 16, 20).chamfer(2, [2, 4, 6, 8]);

Bevel selected edges of a solid by a constant distance.

Complete example: solid operations.

Signature

model.chamfer(distance: number, edgeIds?: readonly EdgeId[]): SolidModel<Elements>;

Import the functions and named types from @code3d/core.

Parameters and result

Parameter Meaning
distance Positive finite distance in model units; required in TypeScript
edgeIds Optional readonly array of IDs from the input solid

Omit edgeIds to bevel all edges. An explicit empty array is rejected. Duplicate IDs are accepted and resolved once, in the input topology's order. IDs must be positive integers or paths of at least two positive integers; for example [2, 4] selects two edges, while [[2, 4]] selects one inherited edge. Unknown or retired IDs throw rather than silently selecting another edge.

The App can supply distance = 1 while editing an incomplete call. Completed TypeScript calls should specify the value. In the example, IDs 2, 4, 6 and 8 select the four edges parallel to Y on the input box.

Frame, members and topology

The method returns a new SolidModel<Elements> and keeps the input local frame, placement, material and exposed interface. It does not mutate the input. Surviving one-to-one topology retains its full ID; replaced edges are retired and new faces or edges receive fresh IDs. A preserved TypeScript interface does not guarantee that every exposed topology reference survives the edit.

Pick the next operation's IDs from the current result. See topology lineage. The method is available on solids only; it is not a free function and cannot round a standalone curve.

Geometry limits

A positive value is not enough to guarantee a buildable result. Small faces, tight corners, interacting modifications and excessive distance can cause degenerate or self-intersecting geometry. The kernel may propagate an edge selection along tangent contours. Failures identify the requested edges and amount, and may report that contour expansion.

Try a different amount or a smaller edge selection when construction fails. The distance is the equal setback used for the bevel, not its slanted face width. Use fillet for a rounded transition. Use shell to create hollow walls.