BRL-CAD
Loading...
Searching...
No Matches
rpc.h
Go to the documentation of this file.
1/* R P C . H
2 * BRL-CAD
3 *
4 * Copyright (c) 1993-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 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this file; see the file named COPYING for more
18 * information.
19 */
20/** @addtogroup rt_rpc */
21/** @{ */
22/** @file rt/primitives/rpc.h */
23
24#ifndef RT_PRIMITIVES_RPC_H
25#define RT_PRIMITIVES_RPC_H
26
27#include "common.h"
28#include "vmath.h"
29#include "rt/defines.h"
30
32
33/**
34 * Approximate a parabola with line segments.
35 *
36 * @param pts Linked list of points; must have at least two nodes on entry.
37 * @param r Rectangular half-width of the parabola.
38 * @param b Breadth (half-height) of the parabola.
39 * @param dtol Maximum allowable chord-to-curve distance (mm).
40 * @param ntol Maximum allowable normal-deviation angle (radians); pass
41 * M_PI to ignore normal tolerance.
42 * @param min_abs Minimum absolute span (mm) below which subdivision stops,
43 * preventing runaway recursion from extremely tight tolerances.
44 *
45 * Recommended min_abs values:
46 * - 0.05 is a conservative default suitable for most CAD
47 * geometry. A full circle at this dtol requires ~300
48 * segments; finer values rarely produce visible improvement
49 * on typical display hardware.
50 * - 0.005 produces noticeably smoother curves on very small
51 * features but can multiply polygon counts by 10x or more.
52 * - Values below dtol have no additional effect until dtol
53 * itself pushes subdivision to segments shorter than min_abs.
54 * - SMALL_FASTF (~1e-37) disables the floor entirely, matching
55 * the deprecated rt_mk_parabola_old() behavior; use only when
56 * the geometry is known to be free of degenerate cases that
57 * could trigger unbounded recursion.
58 *
59 * @return Number of additional points inserted into @p pts.
60 */
62 fastf_t r,
63 fastf_t b,
67
68/**
69 * @deprecated use rt_mk_parabola() with an explicit min_abs argument.
70 * Preserves the original behavior of trusting the caller's tolerances
71 * unconditionally (equivalent to min_abs = SMALL_FASTF).
72 */
74 fastf_t r,
75 fastf_t b,
78
79/** @} */
80
82
83#endif /* RT_PRIMITIVES_RPC_H */
84
85/*
86 * Local Variables:
87 * tab-width: 8
88 * mode: C
89 * indent-tabs-mode: t
90 * c-file-style: "stroustrup"
91 * End:
92 * ex: shiftwidth=4 tabstop=8
93 */
Definition dvec.h:74
Header file for the BRL-CAD common definitions.
#define DEPRECATED
Definition common.h:433
DEPRECATED int rt_mk_parabola_old(struct rt_pnt_node *pts, fastf_t r, fastf_t b, fastf_t dtol, fastf_t ntol)
int rt_mk_parabola(struct rt_pnt_node *pts, fastf_t r, fastf_t b, fastf_t dtol, fastf_t ntol, fastf_t min_abs)
double fastf_t
fastest 64-bit (or larger) floating point type
Definition vmath.h:333
fundamental vector, matrix, quaternion math macros