-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2993 from nortikin/extra_move
Move what possible from Sverchok-Extra (WIP)
- Loading branch information
Showing
229 changed files
with
22,245 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
|
||
Curve | ||
----- | ||
|
||
Sverchok uses the term **Curve** mostly in the same way as it is used in mathematics. | ||
|
||
From the user perspective, a Curve object is just a (more or less smooth) curve | ||
laying in 3D space, which goes from one point (start) to another point (end). | ||
The start and the end point of the curve may coincide, in this case we say the | ||
curve is **closed**, or **cyclic**. | ||
|
||
Let's state some properties of the Curve object, which will define our | ||
understanding of this term in context of Sverchok: | ||
|
||
* A curve is a finite, one-dimensional object, existing in 3D space. | ||
* Every curve must have exactly two endpoints. No more, no less. | ||
* If the endpoints coincide, the curve is considered to be closed. | ||
* There may be no gaps on the interior of a curve, as that would result in more | ||
than two endpoints. | ||
* There may be no branching points on the curve, except where an endpoint is | ||
coincident with some interior point of the curve. | ||
|
||
Mathematically, a Curve is a set of points in 3D space, which can be defined as | ||
a codomain of some function from R to R^3; i.e. the function, which maps some | ||
real number to a vector in 3D space. We will be considering only "good enough" | ||
functions; more exactly, such function must be continuous, and have at least 3 | ||
derivatives at (mostly) each point. | ||
|
||
It is important to understand, that each curve can be defined by more than one | ||
function (which is called parameterization of the curve). We usually use the | ||
one which is most fitting our goals in specific task. | ||
|
||
Usually we use the letter **t** for curve parameter; in some case the letter **u** is used. | ||
|
||
For example, let's consider a straight line segment, which is beginning at `(0, | ||
0, 0)` and ending at `(1, 1, 1)`. The following parameterizations all define | ||
the same line: | ||
|
||
A) | ||
|
||
x(t) = t | ||
|
||
y(t) = t | ||
|
||
z(t) = t | ||
|
||
B) | ||
x(t) = t^2 | ||
|
||
y(t) = t^2 | ||
|
||
z(t) = t^2 | ||
|
||
C) | ||
|
||
x(t) = t^3 | ||
|
||
y(t) = t^3 | ||
|
||
z(t) = t^3 | ||
|
||
As you understand, we can write down as many equations for it as we want. | ||
|
||
Different parametrizations of the same curve can have different values of **t** | ||
parameter corresponding to the beginning and the end of the curve. For example, | ||
|
||
D) | ||
x(t) = t - 1 | ||
|
||
y(t) = t - 1 | ||
|
||
z(t) = t - 1 | ||
|
||
defines the parametrization, for which `t = 1` corresponds to the beginning of | ||
the segment, and `t = 2` corresponds to the end of the segment. The range of | ||
the curve parameter which corresponds to the curve from it's beginning to the | ||
end is called **curve domain**. | ||
|
||
Another important thing to understand is that the value of curve parameter at | ||
some point has nothing to do with the length of the curve. With our straight | ||
line example, if we consider A) parametrization at the point of `t = 0.5`, it | ||
will be `(0.5, 0.5, 0.5)`, i.e. the middle of the segment. But, if we take the | ||
same segment with B) parametrization, `t = 0.5` will give us `(0.25, 0.25, | ||
0.25)`, which is not the middle of the segment at all. | ||
|
||
Among all possible parametrizations of a curve, one is distinguished. It is | ||
called **natural parametrization**. The natural parametrization of the curve | ||
has the property: certain change in **t** parameter corresponds to exactly the | ||
same change in curve length. Each curve has exactly one natural | ||
parametrization. | ||
|
||
Since Blender has mostly mesh-based approach to modelling, as well as Sverchok, | ||
to "visualize" the Curve object, you have to convert it to mesh. It is usually | ||
done by use of "Evaluate Curve" node, or "Curve Length Parameter" node. | ||
|
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,32 @@ | ||
|
||
Scalar Fields | ||
------------- | ||
|
||
A scalar field is a mathematical object, which is defined as a function from R^3 to R, i.e. a mapping which maps each point in a 3D space to some number. Such objects are quite common in mathematics and in physics too; for example, you can take a field of temperatures (which maps each point to the temperature in that point). | ||
|
||
Technically, scalar field is defined as Python class, which can calculate some number for a provided point in space. Note that the definition of the field function can be quite complex, but it does not mean that that complex definition will be executed for all points in 3D space — only for points for which it is actually required to know the value. | ||
|
||
Sverchok can generate such fields by several ways, including user-provided formulas; it can execute some mathematical operations on them (such as addition or multiplication). | ||
|
||
Vector Fields | ||
------------- | ||
|
||
A vector field is a mathematical object, which is defined as a function from R^3 to R^3, i.e. a mapping which maps each point in 3D space into a 3D vector. Such objects are very common in mathematics and in physics; for example, consider the field of some force, for example the gravitation field, which defines the gravitation force vector for each point in space. | ||
|
||
Note that when we are talking about vector fields, there are two possible ways to interpret their values: | ||
|
||
1. to think that the vector, which is defined by vector field in point P, starts in point P and ends in some point P'; | ||
2. to think that the vector which is defined by vector field in point P, starts in the origin and ends in some point Q. | ||
|
||
In physics, the first approach is the most common, and it is mostly used by Sverchok. | ||
|
||
One can note, that both approaches are easily convertible: if you have a field, which maps point P to a vector from 0 to Q, then you can say that you have a field which maps point P to a vector from P to (P+Q). Or the other way around, if you have a field which maps point P to a vector from P to P', then you can say that you have a field which maps point P to a vector from 0 to (P' - P). | ||
|
||
"Apply vector field" node follows the first approach, i.e. for each provided point P it returns the point to which P would be mapped if we understand that the vector VectorField(P) starts at P. Mathematically, it returns `P + VectorField(P)`. In most cases, you will want to use this node instead of "evaluate vector field". | ||
|
||
"Evaluate vector field" node, on the other hand, follows the second approach, i.e. for each point P it returns VectorField(P). | ||
|
||
Technically, vector field is a Python class that can be asked to return a vector for any 3D point. Note that the definition of the field function can be quite complex, but it does not mean that that complex definition will be executed for all points in 3D space — only for points for which it is actually required to know the value. | ||
|
||
Sverchok can generate such fields by several ways, including user-provided formulas; it can execute some mathematical operations on them (such as addition or multiplication). Vector field can be applied to some set of vertices to receive another one — i.e., deform some mesh by field. There are also several ways to convert vector fields to scalar fields (for example, you can take a norm of the vector field, or use divergence differential operator). | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ Contents: | |
|
||
installation | ||
geometry | ||
curves | ||
surfaces | ||
fields | ||
induction | ||
panels | ||
nodes | ||
|
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.