Home > User Guide > Modeling Operations > Warping
Warping Using a Law
Given any one-to-one law from 3D-to-3D, any ACIS body can be warped by that law. The following figure shows an original block with a hole in it. In this example, the law vec(x,y+sin(x),z) is used to warp it by adding sin(x) to the y-coordinate and leaving the other two coordinates alone. This produces the rippled result precisely and with a minimum of calculation.
Scheme Example
(define block1 (solid:block (position -20 -10 -15) (position 20 10 15))) ;; block1 ; block1 => #[entity 2 1] (define cylinder1 (solid:cylinder (position 0 -15 0) (position 0 15 0) 10))) ;; cylinder1 (solid:subtract block1 cylinder1) ;; #[entity 1 1] (law:warp block1 "vec(x,y+3*(sin(x*.5)),z)") ;; (#[entity 1 1])
![]()
Figure. Warping with a Law
Nonuniform Scaling
In this example of nonuniform scaling, the x-coordinate is doubled, stretching the part in that direction. The circular cross-section holes become elliptical, because they are part of the scaled entity.
Scheme Example
(part:load "warp.sat") (define part1 (car (part:entities))) (law:warp part1 "vec(2*x, y, z)")
![]()
Figure. Nonuniform Scaling
Twisting
Twisting is an important and commonly used application of space warping. This example shows a long narrow box with three holes being twisted about an axis that is at 45 degrees to the long side of the box.
Scheme Example
; Create the block and put holes in it. (define b (solid:block (position 0 0 0) (position 200 10 10))) (define c1 (solid:cylinder (position 50 5 0) (position 50 5 10) 2)) (define c2 (solid:cylinder (position 100 5 0) (position 100 5 10) 2)) (define c3 (solid:cylinder (position 150 5 0) (position 150 5 10) 2)) (solid:subtract b c1) (solid:subtract b c2) (solid:subtract b c3) ; Define the transform. (entity:transform b (transform:rotation (position 0 0 0) (gvector 0 0 1) 45)) Define the law. (define f (law "bend(vec(0,0,20),vec(0,1,0),vec(0,0,1),15)")) (law:warp b f 1)
![]()
Figure. Twisting
Twisting and Tapering
In this example, the original box was twisted and tapered up at the same time using a single law definition.
Scheme Example
(define f (law "vec(( x*cos(z*.1)-y*sin(z*.1))*(50-z)*.02, (x*sin(z*.1)+y*cos(z*.1))*(50-z)*.02, z)")) (define b (solid:block (position -10 -10 0) (position 10 10 40))) (law:warp b f)
Figure. Twisting and Tapering
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.