Part Loft Technical Details/it

Questa pagina spiega nei dettagli come viene creata una superficie con Part Loft. Questo vale anche per una superficie Part Sweep prodotta lungo un percorso rettilineo, anche se ci sono alcune differenze.

Le informazioni fornite si riferiscono a una specifica implementazione e potrebbero cambiare. Queste sono adatte per FreeCAD 0.15.4119 e OCC versione: 6.7.0.

Fasi della creazione di Loft
Per spiegare il processo di Loft, convene dividerlo in fasi:
 * 1) creare lo stesso numero di segmenti nei profili (se non sono ancora uguali)
 * 2) stabilire la corrispondenza tra i segmenti
 * 3) produrre la superficie Loft

Fase 1. Creare nei profili il numero di segmenti da abbinare
Lo strumento Loft ha bisogno del numero dei segmenti da abbinare per poter creare delle superfici tra i segmenti corrispondenti. Se il numero di segmenti corrisponde in tutti i profili, questo passaggio viene saltato.

Se almeno uno dei profili ha un numero di segmenti diverso dagli altri, viene applicata la seguente procedura. Per sempicità, in questo esempio la procedura è descritta usando solo due profili.
 * 1) i profili vengono temporaneamente allineati per renderli complanari e far coincidere i loro centri di massa* (baricentri).
 * 2) come si vede nell'immagine sottostante, per ogni vertice di un profilo, il secondo profilo viene suddiviso con lo stesso angolo polare (il centro polare è il centro di massa). Se è possibile fare più di una suddivisione o non è possibile farne nessuna (può succedere su profili molto convessi), il Loft di solito fallisce.
 * 3) lo stesso avviene nella direzione opposta.

L'operazione è applicata a tutti i profili, per produrre in ognuno un numero uguale di segmenti. Il numero totale di segmenti in ciascun profilo sarà pari alla somma di tutti i numeri di segmenti di tutti i profili (capita che su un determinato angolo polare non sia disponibile nessun vertice).

Step 2. Establishing correspondence between segments
In case numbers of segments in all profiles were not equal, slicing was done in Step 1, and the correspondence is trivial. In case numbers of segments in all profiles were equal, existing segments are used (see the picture), and this is when the correspondence must be established.

The exact algorithm to find corresponding segments is complex, but generally it tends to minimize the twisting of the resulting Loft. This means that if one is doing a loft between two squares, the maximum twist possible is <45°. Further rotation of one of the squares will cause the Loft to jump to other vertices.

The correspondence between neighboring profiles is made independently. This means that additional twisting can be obtained by adding more profiles.

Another thing to note is that when numbers of segments in profiles are equal, the resulting Loft is substantially more robust with respect to complex profiles, especially for non-convex ones.

Step 3. Making the loft surface.
If there are only two profiles, the surfaces created are ruled surfaces between corresponding segments of the profiles. Straight edges are created to connect corresponding vertices of the profiles.

If there are more than two profiles, the surfaces are made of splines in the same manner as straight lines form ruled surfaces. The imaginary splines the surface is "made of" are drawn through corresponding points of the corresponding segments of the profiles.

The splines are B-spline interpolation.
 * If the number of profiles is below 10, interpolation is done with by a B-spline with a maximum possible degree (i.e. degree = number_of_profiles - 1).
 * If the number of profiles exceeds 10, the interpolation is switched to 3rd degree B-splines.

The knotting method used is "approximate chord length". Approximate stands for the fact that the knot vector is exactly the same for every spline in a loft. For more info on what is B-spline interpolation, knot vector, chord length method, see, for example, cs.mtu.edu Curve Global Interpolation.

Note that Loft has a "Ruled" property. If it is set to true, ruled surfaces are made between neighboring profiles even when there's more than one profile. That is, B-spline interpolation is replaced by piecewise linear interpolation.

The essence

 * The loft is doing B-spline interpolation between the provided profiles. The interpolation is switched to piecewise linear when "Ruled" property is set to true.
 * When number of profiles exceeds 9, interpolation degree is dropped to 3. This switchover can substantially reduce wiggling.
 * Matching the number of segments (aka number of vertices) in the profiles allows one to give the loft a slight twist, and typically permits using more complex profiles.
 * When numbers of segments are not matched, it's best to keep the profiles to be representable by a proper r(phi) function in polar coordinates.

Additional remarks

 * It is not required that the profiles are parallel (see a picture below).
 * For Loft, it is not required that the profiles are separated (see a picture below). They can be coplanar, but they should not intersect.
 * When "closed" property of the Loft is "true", there is a cusp joint in all the splines forming the Loft (see a picture below). There is no reliable way to close the loft smoothly now.