BRL-CAD
Loading...
Searching...
No Matches
assembly.h
Go to the documentation of this file.
1/* A S S E M B L Y . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2026 United States Government as represented by
5 * the U.S. Army Research Laboratory.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 */
11/** @file brep/assembly.h
12 *
13 * Assemble independently constructed trimmed faces into shared OpenNURBS
14 * topology. These routines do not standardize or compact a B-Rep.
15 */
16
17#ifndef BREP_ASSEMBLY_H
18#define BREP_ASSEMBLY_H
19
20#include "common.h"
21#include "brep/defines.h"
22
23#ifdef __cplusplus
24# include <string>
25#endif
26
28
29#ifdef __cplusplus
30extern "C++" {
31
42
55
56/** Bound whether two curves trace the same locus within @p tolerance.
57 * Returns false when refinement cannot establish coincidence within its
58 * work limit. Point samples alone never establish a match. */
59extern BREP_EXPORT bool
61 double tolerance, bool *reversed = NULL);
62
63/**
64 * Merge unambiguous pairs of coincident naked edges in place.
65 *
66 * Each retained edge acquires the trims from its duplicate. Face pcurves are
67 * not changed. Returns the number of merged edges, or -1 on an OpenNURBS
68 * topology error. Ambiguous matches are deliberately left naked.
69 */
70extern BREP_EXPORT int
71brep_stitch_naked_edges(ON_Brep &brep, double tolerance,
73
74/**
75 * Derive edge tolerances required by authored vertex and trim endpoints.
76 * Geometry is not changed; existing larger tolerances are preserved.
77 */
78extern BREP_EXPORT bool
80
81/** Make face orientations consistent in a closed two-manifold B-Rep. */
82extern BREP_EXPORT bool
84
85/**
86 * Stitch, orient, derive tolerances and flags, and validate an assembled
87 * B-Rep. The return value reports whether the resulting B-Rep is valid;
88 * solidity and incomplete topology are reported separately in @p result.
89 */
90extern BREP_EXPORT bool
91brep_assemble(ON_Brep &brep, double tolerance,
93
94}
95#endif
96
98
99#endif /* BREP_ASSEMBLY_H */
bool brep_set_edge_endpoint_tolerances(ON_Brep &brep, double minimum_tolerance)
bool brep_assemble(ON_Brep &brep, double tolerance, brep_assembly_result *result=NULL)
int brep_stitch_naked_edges(ON_Brep &brep, double tolerance, brep_assembly_result *result=NULL)
bool brep_orient_faces(ON_Brep &brep)
bool brep_curves_coincident(const ON_Curve &first, const ON_Curve &second, double tolerance, bool *reversed=NULL)
brep_assembly_error
Definition assembly.h:32
@ BREP_ASSEMBLY_TOLERANCE_FAILED
Definition assembly.h:40
@ BREP_ASSEMBLY_CULL_FAILED
Definition assembly.h:37
@ BREP_ASSEMBLY_VERTEX_MERGE_FAILED
Definition assembly.h:35
@ BREP_ASSEMBLY_ORIENTATION_FAILED
Definition assembly.h:38
@ BREP_ASSEMBLY_VALIDATION_FAILED
Definition assembly.h:39
@ BREP_ASSEMBLY_INVALID_TOLERANCE
Definition assembly.h:34
@ BREP_ASSEMBLY_OK
Definition assembly.h:33
@ BREP_ASSEMBLY_EDGE_MERGE_FAILED
Definition assembly.h:36
Definition dvec.h:74
Header file for the BRL-CAD common definitions.
enum brep_assembly_error error
Definition assembly.h:52
std::string validation_log
Definition assembly.h:53