Blog Home

Create an Ellipsoid in 3D ACIS

Tue Apr 28, 2015

How To Create an Ellipsoid using 3D ACIS

The 3D analytics supported directly in 3D ACIS include: sphere, block, pyramid, cone, and torus. These shapes can be changed to more generalized shapes using simple tricks that may not be known by everyone. For instance, to create a well behaved ellipsoid, convert a sphere to a spline and perform non-uniform scaling on it, as shown by the following Scheme script:

(define ellipsoid (lambda (r1 r2 r3)

(define x (solid:sphere 0 0 0 1 ) )
(define saved_new_periodic_splitting (option:set 'new_periodic_splitting 3 ) )
    (define ellipsoid (entity:spline-convert x))
    (entity:delete x)
    (entity:scale ellipsoid r1 r2 r3)
    (option:set 'new_periodic_splitting saved_new_periodic_splitting )
    ellipsoid
))
(ellipsoid 0.2 0.3 0.4)

In C++, you would perform something like the following:

BODY* ellipsoid = 0;
outcome result;
check_outcome( result = api_set_int_option( "new_periodic_splitting", 3 ) );
check_outcome( result = api_solid_sphere( SPAposition( 0, 0, 0 ), 1, ellipsoid ) );
check_outcome( result = api_transform_entity( ellipsoid, scale_transf( radius_x, radius_y, radius_z ) ) );
check_outcome( result = api_change_body_trans( ellipsoid, NULL ) );

The same logic can be applied to the other 3D analytics, as well as other surfaces.

Tags: 3D ACIS