Advanced Springback Examples
From DocR21
This section describes some pitfalls and counter-strategies when using Springback.
Multiple Stamping with Boundary Planes
In this example, we revisit the previous multiple stamping problem, which gave unsatisfactory results with a single application of api_spring_back. Here we apply api_spring_back twice, each time with a different boundary plane to fix the part of the domain.
Scheme Example
(define b (sheet:2d (sheet:face (face:plane (position 0 0 0) 10 10)))) (define t (sheet:2d (sheet:face (face:plane (position 0 0 0) 10 10)))) (entity:transform t (transform:rotation (position 0 0 0) (gvector 0 1 0) -100)) (solid:unite b t) (define t (sheet:2d (sheet:face (face:plane (position 0 0 0) 10 10)))) (entity:transform t (transform:rotation (position 10 0 0) (gvector 0 1 0) 100)) (solid:unite b t) ; pick the edge which will be moved in the shaping constraint (ray:queue -106.642 480.042 -98.6471 0.209863 -0.95324 0.217465 0.320618) (define eb1 (pick-edge)) ; translate to make the after edge of the shaping constraint (define ea1 (entity:transform (entity:copy eb1) (transform:translation (gvector 1.5 0 0)))) (define wb1 (wire-body eb1)) (define wa1 (wire-body ea1)) (define press-dir (gvector 1 0 1)) (define sbd (spring-back:definition press-dir)) (spring-back-definition:add-shaping-constraint sbd (list wb1) (list wa1)) (spring-back-definition:set-boundary-plane sbd (position 0 0 0) (gvector -1 0 1)) ; define the body (define f (filter:type 'solid?)) (define b (list-ref (filter:apply f (part:entities))0)) ; apply the spring back deformation (entity:spring-back b sbd) (ray:queue -340.739 -158.887 -316.993 0.695109 0.318193 0.644653 0.320618) (define eb2 (pick-edge)) (define ea2 (entity:transform (entity:copy eb2) (transform:translation (gvector -1.5 0 0)))) (define wb2 (wire-body eb2)) (define wa2 (wire-body ea2)) (define press-dir (gvector 1 0 -1)) (define sbd (spring-back:definition press-dir)) (spring-back-definition:add-shaping-constraint sbd (list wb2) (list wa2)) (spring-back-definition:set-boundary-plane sbd (position 10 10 0) (gvector 1 0 1)) ; apply the spring back deformation (entity:spring-back b sbd)
Multiple Shaping Constraints
The body in the following example is a swept angle bracket that has blended edges. In this example, a fixed constraint is made using a face and two of its edges. Also, there are two separate wires in the shaping constraint, in order to realize a more complex desired shape. Note that one pair of the shaping constraint wires does not lie on the before/after body; this arises naturally here, as these constraint wires correspond to one of the edges that has been blended away.
The press direction in this example is chosen to roughly match the center of the constraint motion. As stated in the constraint guidelines section, this helps produce bodies with better shape, better parameterization, and better constraint satisfaction (smaller gaps).
; Step 1 - define the body to which api_spring_back will be applied (define e1 (edge:linear (position 3 9 0) (position 8 9 0))) (define e2 (edge:linear (position 8 9 0) (position 12 0 0))) (define e3 (edge:linear (position 12 0 0) (position 16 0.5 0))) (define w-prof (wire-body (list e1 e2 e3 ))) (define e (edge:circular (position 105.5 9 0) 100 180 210)) (define tr (transform:rotation (position 105.5 9 0) (gvector 1 0 0) -90)) (entity:transform e tr) (define w-path (wire-body e)) (sweep:law w-prof w-path ) (entity:delete w-path) ; Step 2 - set up the shaping constraints (ray:queue 90.2503 474.389 122.54 -0.158463 -0.969377 -0.187611 1) (define e1 (pick-edge)) (ray:queue 92.4031 475.38 115.602 -0.158463 -0.969377 -0.187611 1) (define e2 (pick-edge)) ;save a copy e2 as a "before" wire for a shaping constraint (define wb1 (wire-body (entity:copy e2))) (solid:blend-edges (list e1 e2 ) 1) (define e (edge:circular (position 105.5 -0.3 0) 95.5 180 210)) (define tr (transform:rotation (position 105.5 -0.3 0) (gvector 1 0 0) -90)) (entity:transform e tr) (define wa1 (wire-body e)) (define e (edge:circular (position 105.5 -0.3 0) 91.4 180 210)) (define tr (transform:rotation (position 105.5 -0.3 0) (gvector 1 0 0) -90)) (entity:transform e tr) (define wa2 (wire-body e)) (ray:queue 149.021 71.6749 207.673 -0.527653 -0.282718 -0.801032 0.134218) (define eb2 (pick-edge)) (define wb2 (wire-body eb2)) ; Set up the fixed constraints (ray:queue 106.603 -279.163 407.693 -0.198548 0.569223 -0.797849 1) (define ff (pick-face)) (ray:queue 189.72 33.8223 477.761 -0.372209 -0.0498911 -0.926807 0.28991) (define ef1 (pick-edge)) (ray:queue 192.706 33.4477 476.582 -0.372209 -0.0498911 -0.926807 0.28991) (define ef2 (pick-edge)) (define wf1 (wire-body ef1)) (define wf2 (wire-body ef2)) (entity:set-color (entity:edges wa1) BLUE) (entity:set-color (entity:edges wa2) BLUE) (entity:set-color (entity:edges wb1) CYAN) (entity:set-color (entity:edges wb2) CYAN) ;Set up the spring back problem. Choose the press direction to roughly match the center of the shaping constraint motion. (define sbd (spring-back:definition (gvector 2 1 -0.5))) (spring-back-definition:add-shaping-constraint sbd (list wb1 wb2 ) (list wa1 wa2)) (spring-back-definition:add-fixed-constraint sbd (list wf1 wf2 ff)) (define f (filter:type 'solid?)) (define b (list-ref (filter:apply f (part:entities)) 0)) (entity:spring-back b sbd) ; Since there is a significant movement of the part, this spring back definition has moderate fairness. (spring-back-definition:get—deformation-fairness sbd)
Multiple Shaping Constraints II: Conflicting Constraints
As previously stated, constraint data generated from measurements or FEA analysis of a single stamping should not produce conflicting constraints. On the other hand, it is easy to generate conflicting constraints with contrived data. Consider the following variation on the previous example, which tries to constrain the vertical side of the bracket to be straight, with poor results.
Example of Bad Constraints: Conflict Between Fixed and Shaping Constraints
(part:clear) ;; define planar sheet body with three faces (define p1 (position 0 0 0)) (define p2 (position 2 0 0)) (define p3 (position 2 4 0)) (define p4 (position 0 4 0)) (define e1 (edge:linear p1 p2)) (define e2 (edge:linear p2 p3)) (define e3 (edge:linear p3 p4)) (define e4 (edge:linear p4 p1)) (define w (car (wire-body:group (list e1 e2 e3 e4)))) (define b (sheet:cover-circuit (entity:edges w))) ; choose geometry for spring back definition (ray:queue -1.95024 2.57832 -4.72247 0.524455 -0.156472 0.836937 1) (face:split #f #t .7 (pick-face)) (ray:queue 0.678795 4.20287 -5.30834 0.055449 -0.151366 0.986921 1) (face:split #f #t .2 (pick-face)) (entity:set-color (entity:edges (part:entities)) RED) (ray:queue -3.1082 1.58239 -3.81661 0.712287 -0.0298439 0.701254 1) (define fixed-face (pick-face)) (entity:set-color fixed-face BLUE) (ray:queue -2.91049 4.16305 -3.90761 0.712287 -0.0298439 0.701254 .1) (define fixed-edge (pick-edge)) (define fixed-wire (wire-body fixed-edge)) (entity:set-color fixed-wire BLUE) (ray:queue -3.01405 3.21773 -3.84265 0.712287 -0.0298439 0.701254 .1) (define edge-to-move (pick-edge)) (entity:set-color edge-to-move CYAN) (define target-edge (edge:linear (position 0 3.04 0.5)(position 2 3.04 0.5))) (zoom:all) (define press-dir (gvector 0 0 1)) (define sbd (spring-back:definition press-dir)) (spring-back-definition:add-fixed-constraint sbd (list fixed-face fixed-wire)) (spring-back-definition:add-shaping-constraint sbd (list (wire-body edge-to-move))(list (wire-body target-edge))) ;; this seemingly innocent springback definition is very much over constrained. (define sbo (spring-back:options)) (spring-back-options:set-do-checks sbo #f) (entity:spring-back (entity:owner b) sbd sbo) ;; the deformation fairness for this spring back definition is very low, ;; because the problem is over constrained. (spring-back-definition:get-deformation-fairness sbd) ;; moral of the story: bad results will occur if deformation fairness is low.
Blue face and edge are supposed to be fixed, while the cyan edge is supposed to move to the green one.
Figure. Result of spring back operation using spring back definition with very low deformation fairness. Notice that fixed constraints were grossly violated: the blue "fixed face" is wiggly and not at all planar.
Example of Bad Constraint Definition: Misaligned Wires
The spring back definition we are going to use will take the outer rim of the torus to the green circle. Because the start vertices are 180 degrees out of alignment, the result will be very bad.
Figure. The deformation resulting from the spring back definition above produced useless results, because the start vertices were not properly aligned: the deformation tried to twist the outer rim of the circle a by a half turn, leaving the inside rim fixed. To see this output, the do-checks option was set to false.
Note: Unusable results similar to those above can result from mismatching the orientation of "before" and "after" wires. If you see a result like this, it is very likely that the starting point or orientation of some shaping constraint wires do not match up. Therefore, in this sort of situation, recheck the spring back definition.
Example of Bad Constraint Definition: Constraints Should Not Stretch
In the situation spring back is intended to model, the faces acted on should not be stretched much. However, the interface for api_spring_back allows you to specify before and after constraints arbitrarily. This allows subtle constraint conflicts to arise.
In the picture below, we are looking at three bracket shaped objects: the blue bracket is meant to model the shape metal that would spring back to if stamped with the green shape. The light blue (cyan) shape is the result of applying api_spring_back to the green sheet using densely sampled constraint wires from the blue sheet to get the before and the green sheet to get the after constraints. Notice the unrealistic ripples in the cyan bracket.
The problem here is with the spring back definition: both the green and dark blue parts were without any physical data. The blend faces on the green and blue brackets are cylinders with the same radius, subtending slightly different angles. The spring back definition pulls the edges of the blue blend face to meet the corresponding edges of the green blend face, effectively stretching the blend face out, and therefore flattening it slightly. The densely sampled constraint wires of the blend face attempt to pull the face upward. So there are ripples which follow the constraint wires.
Also note that the deformation fairness for the spring back definition is fairly low. This reflects the fact that the deformation causes these ripples.
Example. Bad Constraint Definition: Wire Constraints Must Be G1
The spring back definition illustrated by the following picture, where the blue wire is sent to the red wire will not work, because neither wire is G1. The function api_spring_back is limited to dealing with constraint wires where adjacent edges are tangent where they meet.
To define this spring back problem correctly, each edge of each square must be contained in its own separate wire.
