-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
github-actions
committed
Oct 26, 2024
1 parent
7df885f
commit c27f06a
Showing
102 changed files
with
1,097 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
Curve to NURBS | ||
============== | ||
|
||
Functionality | ||
------------- | ||
|
||
This node allows to: | ||
|
||
* Convert arbitrary (non-NURBS) curve to NURBS curve; | ||
* Reparametrize any curve: given one curve, make a NURBS curve with "natural" | ||
(uniform) parametrization, or with arbitrary parametrization. | ||
|
||
More specifically, what this node does is: | ||
|
||
* Evaluates initial curve at some number of points; these node can be defined | ||
by uniform distribution of curve T parameter, or by dividing curve into | ||
segments of equal length. If initial curve is already NURBS or NURBS-like, | ||
this node will always use curve's "fracture" (crisp) points as such base | ||
points, in order to preserve fracture points at same places. | ||
* Interpolates a NURBS curve through these points, using one of criteria to | ||
define T parameters of new curve at these points - this will define | ||
parametrization of the curve. | ||
* In the end, resulting NURBS curve is simplified by removing as much | ||
unnesessary knots as possible, while trying to change it not too much. | ||
|
||
Inputs | ||
------ | ||
|
||
This node has the following inputs: | ||
|
||
* **Curve**. The curve to be converted to NURBS. This input is mandatory. | ||
* **Degree**. Degree of resulting NURBS curve. The default value is 3. | ||
* **Samples**. Number of base points on the curve, which will be used for | ||
interpolation. More samples will give NURBS curve which follows initial curve | ||
more precisely, but have more control points (and will take more time to | ||
calculate). The default value is 50. | ||
* **LengthResolution**. This input is available only when **Parametrization** | ||
parameter is set to **Natural (Curve Length)**. Resolution which is used to | ||
calculate curve length. Bigger value will give more precise calculation, but | ||
will take more time to calculate. The default value is 50. | ||
* **Parametrization**. This input is available and mandatory only when | ||
**Parametrization** parameter is seto to **Arbitrary**. The curve in this | ||
input defines wanted parametrization of NURBS curve. The node expects a curve | ||
which lies in XOY plane and has [0; 1] as it's domain, and it's expected that | ||
Y coordinate of point on the curve is growing with growth of T parameter, | ||
while remaining in [0; 1] bounds. | ||
* **Tolerance**. This input is available only when **Simplify** parameter is | ||
checked. This defines tolerance value used when removing excessive knots of | ||
interpolated NURBS curve. Lower values will give curves which follow initial | ||
curve more precisely, but have more control points. The default value is 1e-6 | ||
(one per million). | ||
|
||
Parameters | ||
---------- | ||
|
||
This node has the following parameters: | ||
|
||
* **Parametrization**. This defines parametrization of resulting NURBS curve. | ||
The available options are: | ||
|
||
* **Natural (Curve Length)**. Curve T parameter of some point on the curve | ||
will be equal (approximately) to length of the curve segment from start to | ||
that point. | ||
* **Keep Original**. Parametrization of resulting curve will be the same as | ||
parametrization of input curve. | ||
* **Arbitrary**. This allows to specify arbitrary curve parametrization by | ||
providing a curve in **Parametrization** input. | ||
|
||
The default option is **Natural (Curve Length)**. | ||
* **Simplify**. If checked, the node will try to simplify the curve after | ||
interpolation. With big enough values of **Samples** input, interpolated | ||
curve will have a lot of control points, some of which are not really | ||
necessary if you do not need too much precision. Checked by default. | ||
|
||
Outputs | ||
------- | ||
|
||
This node has the following output: | ||
|
||
* **Curve**. The resulting NURBS curve. | ||
|
||
Examples of Usage | ||
----------------- | ||
|
||
General nodes setup: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_nodes.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_nodes.png | ||
|
||
If we specify Parametrization = "Keep Original", then for NURBS curves node | ||
will basically return the same curve (slightly modified due to algorithms | ||
involved): | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_original.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_original.png | ||
|
||
So if you already have a NURBS curve, it does not make sense to use original | ||
parametrization. It may, however, make sense for generic curves, see below. | ||
|
||
In the following case we already have Bezier curve, but we want to have a NURBS | ||
curve with uniform parametrization: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_bezier_degree_3.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_bezier_degree_3.png | ||
|
||
Note that while the curve is smooth, it's curvature comb is not smooth. If we | ||
want it to be smooth, we can use NURBS curves of higher degree: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_bezier_degree_4.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_bezier_degree_4.png | ||
|
||
It is possible to create NURBS curves with arbitrary parametrization. Nodes setup: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_arbitrary_nodes.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_arbitrary_nodes.png | ||
|
||
"Formula interpolate" node defines the following reparametrization curve in this case: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_arbitrary_parametrization.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_arbitrary_parametrization.png | ||
|
||
This gives the following result: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_arbitrary_result.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_arbitrary_result.png | ||
|
||
Let's check with arbitrary curve; in this case it's a straight line segment | ||
deformed by vector noise field: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_noise_nodes.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_noise_nodes.png | ||
|
||
With Parametrization = "Keep Original" this gives: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_noise_keep.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_noise_keep.png | ||
|
||
With Parametrization = "Natural" this gives: | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_to_nurbs_noise_natural.png | ||
:target: ../../../docs/assets/nodes/curve/curve_to_nurbs_noise_natural.png | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
NURBS Curve Discontinuity | ||
========================= | ||
|
||
Functionality | ||
------------- | ||
|
||
Given a NURBS (or NURBS-like) curve, this node finds it's "fracture", or | ||
"discontinuity", points. | ||
|
||
* Discontinuity points of 1st order are points where curve changes is not | ||
smooth, i.e. it changes it's direction suddenly; more precisely, it's points | ||
where curve derivative (tangent) is not continuous. | ||
* Discontinuity points of 2nd order are points where curve's 2nd derivative is | ||
not continuous; | ||
* Discontinuity points of 3rd order are points where curve's 3rd derivative is | ||
not continuous. | ||
|
||
This node can find discontinuities of two kinds: | ||
|
||
* Geometric discontinuity is a point where curve derivative (tangent vector or | ||
derivative vector of higher order) changes it's direction suddenly; it does not matter | ||
if it changes it's length or not. | ||
* Parametric discontinuity is a point where curve derivative suddenly changes | ||
it's direction or length. | ||
|
||
Geometric discontinuity of 1st order is clearly visible: it's a "sharp corner" | ||
on a curve. Parametric discontinuity may not be visible, if tangent direction | ||
is not changed; in such a case, parametric discontinuity matters only for the | ||
parametrization of the curve. | ||
|
||
Inputs | ||
------ | ||
|
||
This node has the following inputs: | ||
|
||
* **Curve**. The curve to be analyzed. This input is mandatory. | ||
* **Order**. Discontinuity order. Possible values are 1, 2 and 3. The default | ||
value is 1. | ||
* **AngleTolerance**. Minimum angle, for which curve's derivative (tangent or | ||
derivative vector of higher order) should change it's direction, in order for | ||
such point to be considered as discontinuity. The value is specified in | ||
radians. The default value is 1e-6 (one per million). | ||
* **AmplitudeTolerance**. This input is available only when **Geometric** | ||
parameter is not checked. Minimum value, for which curve's derivative vector | ||
should change it's length, in order for such point to be considered as | ||
discontinuity. The default value is 1e-6 (one per million). | ||
|
||
Parameters | ||
---------- | ||
|
||
This node has the following parameter: | ||
|
||
* **Geometric**. If checked, the node searches for geometric discontinuities | ||
only. Otherwise, it searches for parametric discontinuities. Checked by | ||
default. | ||
|
||
Outputs | ||
------- | ||
|
||
This node has the following outputs: | ||
|
||
* **Segments**. Segments, to which the curve is split by discontinuity points. | ||
* **Points**. Discontinuity points on the curve. | ||
* **T**. Curve's T parameter values for discontinuity points. | ||
|
||
Examples of usage | ||
----------------- | ||
|
||
Discontinuity of 1st curve is visible as a break (crisp) on the curve. Here we | ||
check only for "Geometric" continuity, which means that we only check | ||
directions of curve tangents, but do not check tangent lengths. | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_discontinuity_1.png | ||
:target: ../../../docs/assets/nodes/curve/curve_discontinuity_1.png | ||
|
||
Here we check for "parametric" continuity instead of "geometric". Now we see | ||
two points of discontinuity. Point 1 is the same; at point 2, with curve's | ||
control polygon displayed we can see that control points are not symmetric | ||
around this point, in this case this means that curve tangent vector at the | ||
right of this point have much more length, than curve tangent to the left of | ||
this point. | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_discontinuity_2.png | ||
:target: ../../../docs/assets/nodes/curve/curve_discontinuity_2.png | ||
|
||
Since this curve is composed of several Bezier segments, in all points where | ||
these segments are "glued" together there are points of discontinuity of 2nd | ||
order. If you look at curvature comb near these points, you can see that it can | ||
be discontinuous ("broken"). I.e., at these points curve's curvature may change | ||
suddenly. | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_discontinuity_3.png | ||
:target: ../../../docs/assets/nodes/curve/curve_discontinuity_3.png | ||
|
||
This is a generic NURBS curve. It does not have discontinuity points of 1st or | ||
2nd order. But it has discontinuity points of 3rd order; At these points the | ||
curve itself looks pretty smooth, but if you look closely at curvature comb you | ||
can see that, albeit continuous, curvature comb is not smooth at these points. | ||
|
||
.. image:: ../../../docs/assets/nodes/curve/curve_discontinuity_4.png | ||
:target: ../../../docs/assets/nodes/curve/curve_discontinuity_4.png | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.