1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/******************************************************************************
Author: Joaquín Béjar García
Email: jb@taunais.com
Date: 26/8/24
******************************************************************************/
use Decimal;
use BTreeSet;
/// Parameters for constructing geometric objects in different dimensions.
///
/// This enum provides configuration options for different dimensional spaces
/// when generating geometric objects through parametric equations or sampling.
/// It supports both 2D curves (with a single parameter t) and 3D surfaces
/// (with two parameters x and y).
/// Defines methods for constructing geometric objects.
///
/// This enum provides two primary approaches to creating geometric objects:
/// - Direct construction from a set of predefined points
/// - Parametric generation using a mathematical function
///
/// The generic parameters allow flexibility in the types of points and input parameters used:
/// - `Point`: The type representing a coordinate in the geometric space
/// - `Input`: The parameter type passed to parametric functions (typically `Decimal` for 2D or `(Decimal, Decimal)` for 3D)
/// - `Error`: The error the parametric generator reports.
/// [`crate::geometrics::GeometricObject::construct`] binds it to the
/// object's own `Self::Error`, so a generator for a
/// [`crate::curves::Curve`] returns [`crate::error::CurveError`] and one
/// for a [`crate::surfaces::Surface`] returns
/// [`crate::error::SurfaceError`]. The generator's own failure travels in
/// that type's `Generator` variant, which keeps the original cause as its
/// `source` rather than flattening it at the construction boundary.