Operations on Bodies, Curves, Surfaces, etc.   

<<< Creation of Primitives Chapters Local Operation Functions >>>

Contents

[back to top]


6.1 Introduction

This section covers the operations which can be performed on bodies etc. which have been created as primitives or, in the case of bodies, have been received.

[back to top]


6.2 Booleans

A number of functions exist for operations which are only possible on bodies, such as the boolean functions unite and subtract. A list and a few examples of these functions appear below.

 

Object

Function

body

check, unite, subtract, intersect, section, merge, unfix

Assume two overlapping bodies b1 and b2 are created or received prior to each of the following examples. In these examples b1 is the target and b2 is the tool body. These commands preserve the tag of the target body and also return an appropriately named object of type body containing the complete body set of the resulting boolean operation (i.e. its tag property is a list of tag values):

One of the resultant bodies has the same tag as the target body and this is the item that the target object refers to, it is not in general defined which of the result bodies this is. The section operation is slightly different: the tool object must be a surface, not a body, and the target object, on completion, refers to the set of items which lie on the front (i.e. in the direction of the sectioning surface normal) of the sectioning surface, while section_temp refers to the set of objects at the back.

As a side effect of the boolean operation the tool body is deleted from the kernel, its tag is dead and attempts to refer to it again produce an error.

When intersecting a sheet (target) with a solid (tool) body, the result is another sheet. The result of an intersect must be the same as the target body.

check function

 

> (b1 check)       -- check the body is valid

unite function

 

> (b1 unite ´b2)  -- b1 is now b1 + b2
                     (if required, b2 can be a list of bodies)

subtract function

 

> (b3 subtract ´b4)    -- b3 is now b3 - b4

intersect function

 

> (b5 intersect ´b6)   -- b5 is now the intersecting volume

[back to top]

6.2.1 Multiple bodies

Multiple tool bodies are supported in KID Booleans using:

 

> (b0 unite ´( b1 b2 ))
> (b0 intersect ´( b1 b2 b3 ))
> (b0 subtract ´( b1 b2 ))

[back to top]

6.2.2 Sectioning primitives

halve and quarter functions

Two additional sectioning functions that assist the rapid shaping of primitives are:

 

> (body halve <body axis> )
> (body quarter <body axis> )     -- think of cutting a cake

These functions section symmetric bodies with respect to the given axis, through their center of gravity. If the axis direction is missed out it defaults to '( 0 0 1 ) .

[back to top]

6.2.3 Operations on the single class

The single class consists of the topological items face, edge and vertex. The functions merge and unfix are inherited by these topological items.

merge function

merge removes redundant faces, edges and vertices.

unfix function

unfix detaches, geometry from a face, edge or vertex.

[back to top]


6.3 Sewing

When an object of class body tag list contains a set of sheet bodies, these sheet bodies can, wherever possible, be knitted together to form a single sheet or solid body using the function sew .

sew function

 

> (b0 sew ´solid)

As real parts often need manual intervention to set their edge tolerances before the sewing operation completes successfully, the function tolerance supplied.

tolerance function

tolerance operates on edges and can be used to either set the tolerance on a Parasolid edge or to enquire its tolerance.

 

> (e0 tolerance 0.000254) 
                   -- set the tolerance of edge e0 to 0.000254
> (e0 tolerance)   -- enquire the tolerance of edge e0

[back to top]


6.4 Transforming bodies

All subclasses of the transformable class (body, surface, face etc.) can be moved and rotated. The functions require that the objects have properties which define the transformation.

move function

move has two properties; a vector (direction), which is required and a scalar (distance), which is optional. The object is moved in the direction given by the direction vector, through a distance given by the distance property if it is set, or by the magnitude of the direction vector if the distance property is not set.

rotate function

Properties for rotate are direction, point and angle, all are required.

 

Object

Function

transformable

move, rotate

Move a body a specified distance and direction:

 

> (define b0 p_block)
> (b0 help create)
> (b0 x 10; y 10; z 10; create)
> (b0 help move)                         --> information
> (b0 direction ´(0 1 0); distance 12)    -- b0 is a body
> (b0 move)        -- this moves b0 12 units in the Y direction

rotate a body about the X axis by a specified angle:

 

> (b3 point ´(0 0 0); direction ´(1 0 0) ; angle 45)
> (b3 rotate)       -- rotate b3 about the X axis by 45 degrees

move a face(set) a specified distance and direction:

 

> (f1 direction ´(0 0 1); distance 2)
> (f1 move)          -- move f1 2 units in the Z direction

move a face(set) by the supplied direction vector:

 

> (f2 direction ´(3 4 5))
> (f2 move)        -- if no distance is supplied then the item
                       will be moved by the direction vector

[back to top]


6.5 Blends

It is possible to create unfixed blends. The primitive for a general blend class p_blend is set by itype to a default of a true rolling ball blend. The class p_chamfer has local properties of type corresponding to true chamfer blends while p_fillet duplicates the p_blend default to true rolling ball blends. Defaults for properties such as range and type can be found with the help facility.

p_vrb and p_ff_blend are instances of p_blend. (p_vrb help) and (p_ff_blend help) give the properties specific to these instances; anything else relevant they inherit from p_blend.

[back to top]

6.5.1 Creating unfixed blends

p_blend, p_fillet, p_chamfer

The first steps in attaching a blend are:

All of these properties have default values, except for r1 and r2, which are the ranges of the blend on the two faces adjacent to the edge the blend is to be applied to. Only r1 is appropriate for a p_fillet .

If it is required to reverse the sense of the blend, a property of the primitive blend named rev can be set to true before using the function apply to attach the blend to the edge.

Having defined a p_blend , p_fillet or p_chamfer the values to be used for the blend parameters can be set or changed. Only a single value of the range properties r1 and r2 needs to be given in order to define the blend, in this case the blend is symmetric. The thumbweight value for all blends is set to 1.0 and cannot be changed. Although it is possible to change the type this could lead to confusion as it does not change the type of the KID object concerned, so it is not recommended.

blending properties

Blending properties, when required, must be set before the blend is applied:

 

Property

Description

smooth

t => BLECSM option

propagate

t => BLECPR option

cliff_edge

takes edge object and passes it in with the BLECCL option

irib

t => pass rib value in with BLECRI option

draw

t => BLECDF option

p_vrb

This allows you to specify a positions property (either a list of values or the string 'ends ) and a ranges property of the same length (except for 'ends for which it should be of length 2) which is passed into variable radius blend creation. For example:

 

(undefine b0 e0 bl0)
((define b0 p_block) create)
((define e0 edge) pick_from ´b0; 
 pick_using ´(e0 clash ´(5 0 10)))
((define bl0 p_vrb) ranges ´(1 4); positions ´ends; apply ´e0)
(b0 blend_fix; check)
(undefine b0 e0 bl0)
((define b0 p_block) create)
((define e0 edge) pick_from ´b0; 
 pick_using ´(e0 clash ´(5 0 10)))
((define bl0 p_vrb)
   ranges ´(1 3 4);
   positions ´((5 5 10)(5 0 10)(5 -5 10));
   apply ´e0)
(b0 blend_fix; check)

p_ff_blend

This requires the specification of the two walls of faces to be blended, then the blending options if changes from the default values are required. The face sets are defined as

 

((define ff0 p_ff_blend)
left_wall ´f0;
left_sense t;
right_wall ´f1;
)

The options settings can be examined by:

 

(ff0 options)

There is then a simple way to set up all the relevant properties using KI tokens and the function convert_ki_options:

 

((define ff0 p_ff_blend)
  convert_ki_options
    (list
      ´(FXFTCB 0.005)
      ´(FXFTTL 0.00003)
      ´(FXFTPR)
      ´(FXFTMS)
      ´(FXFTAT)
      (list ´FXFTCE (list (e0 tag)(e1 tag)))
    )
)

Alternatively, each property required can be specified by name:

 

(ff0 cliff_edges ´e0; --- FXFTCE
r1 0.005;             --- FXFTCB
tolerance 0.00003;    --- FXFTTL
propagate t;          --- FXFTPR
multiple_sheets t;    --- FXFTMS
walls ´attach;        --- FXFTAT
create)

The create reports an error if one occurs, and raises a LISP error if (option raise_blending_errors t) has been set.

The functions which require 1D curve data extract the relevant data (x, y and z components) from the given curve. For example, if c0 is a 3D B-curve with tag 28:

 

((define ff0 p_ff_blend)
  range1_curve ´c0; --- extract the x component
  range2_curve ´c0; --- extract the y component
  rho_curve ´c0; --- extract the z component
  ...
  create)
((define ff0 p_ff_blend)
  range1_curve c0; --- extract the x component
  range2_curve c0; --- extract the y component
  rho_curve c0; --- extract the z component
  ...
  create)
((define ff0 p_ff_blend)
  range1_curve 28; --- extract the x component
  range2_curve 28; --- extract the y component
  rho_curve 28; --- extract the z component
  ...
  create)

If c0, c1 and c2 are 1D B-curves (tags 29, 30, 31):

 

((define ff0 p_ff_blend)
  range1_curve ´c0;
  range2_curve ´c1;
  rho_curve ´c2;
  ...
  create)
((define ff0 p_ff_blend)
  range1_curve c0;
  range2_curve c1;
  rho_curve c2;
  ...
  create)
((define ff0 p_ff_blend)
  range1_curve 29;
  range2_curve 30;
  rho_curve 31;
  ...
  create)

The data can also be input explicitly:

 

((define ff0 p_ff_blend)
  range1_curve ´( 3 1 nil ( 7.0 8.0 9.0 9.0 9.0 8.0 7.0 )
  ( 4 3 4 ) ( -10.0  0.0 10.0 )
  PK_knot_piecewise_bezier_c nil t );
  ...
  create)

apply function

To attach the blend attribute to the model, the function apply is used.

 

Note: The name of the edge to attach the blend to must be quoted. The default setting of itype for p_blend is 3, the value for a true rolling ball blend.

Object

Function

p_blend, p_fillet, p_chamfer, p_vrb, p_ff_blend

apply

 

> (p_blend help apply)    --> information
> (define f1 p_blend)
> (f1 r1 3.2)              -- reset range values
> (f1 apply ´e0)   -- apply offset blend to edge e0
                       (e0 has already been defined and picked)

[back to top]

6.5.2 Checking, enquiring and removing unfixed blends, and picking blends

 

Object

Function

edge

pick_blends, blend_remove, blend_check, blend_enquire

blend_check function

blend_check checks the validity of a blend on a particular edge, or set of edges.

 

> (e0 blend_check)      -- check unfixed blend on edge(s) e0

blend_enquire function

blend_enquire returns blend information.

 

> (e0 blend_enquire)   -- information on unfixed blends on 
                          edge(s) e0

blend_remove

The function blend_remove can be used to remove any unfixed blend attribute from an edge. Once blends have been fixed, blend_remove can not remove a blend from an edge.

 

> (e0 blend_remove)    -- remove unfixed blend from edge(s) e0

pick_blends function

pick_blends identifies the edge(s) of a body which has unfixed blends attached.

 

> (e0 pick_blends ´b0) -- pick unfixed blend on edge(s) e0 from
                          body b0

[back to top]

6.5.3 Fixing blends

blend_fix function

The blend_fix function fixes all unfixed blends on a specified body.

 

Object

Function

body

blend_fix

 

> (b0 blend_fix)     -- all unfixed blends are fixed in body b0

[back to top]

6.5.4 Extracting blend information from a blended body

extract function

The function extract extracts the blend information from a blended edge into the properties of a p_blend primitive. This leaves the edge without a blend. Blend extraction is from one edge only, and returns t if the extraction has been successful.

 

Object

Function

p_blend

extract

 

> (define bl1 p_fillet)   -- define blend
> (bl1 r1 5; apply ´e1)   -- and apply to edge e1
> (define bl2 p_blend)    -- define bl2 as a p_blend
> (bl2 extract ´e1)
               -- extract blend information from e1 into bl2
> (bl2 r1 1;apply ´e1)   -- change parameter and re-apply to e1

[back to top]

6.5.5 Creating a cliff-edge blend

cliff_edge blend function

The function cliff_edge creates a cliff edge, but does require that the edge that is the "cliff to" edge is specified.

 

> (define bl1 p_fillet)           -- define blend
> (bl1 r1 5)                      -- set range values
> (bl1 cliff_edge ´e0; apply ´e1) -- apply blend, `cliff to´ e0

[back to top]

6.5.6 Defining and fixing a blend in a single operation

To define and fix a blend in a single operation use either of the relevant fillet or chamfer functions.

 

> ( topology fillet <radius> )
> ( topology chamfer <radius> )

Fillet and chamfer work :

Fillet also works on sheet and wire bodies :

[back to top]

6.5.7 Blending on vertices

Support for variable radius blends is by filleting a vertex object with two tags and 2 radii.

 

> ( define v0 vertex )
> ( v0 pick )
> ( v0 pick )                -- two vertices on a single edge
> ( v0 fillet ´( 1.5 5.5 ))  -- varying radii

[back to top]


6.6 Sweeping and swinging

Many subclasses of the topology class can be modified with the functions sweep and swing .

sweep function

The sweep function takes a vector as its argument.

swing function

The swing function takes as its arguments:

 

Object

Function

topology

sweep, swing

Using sweep to create a solid body from a minimum body:

 

> (define b1 p_acorn)
> (b1 create)              -- b1 is an acorn at the origin
> (b1 help sweep)          -- for information on sweeping b1
> (b1 sweep ´(10 0 0))     -- b1 is now a wire body
> (b1 sweep ´(0 20 0))     -- b1 is now a sheet body
> (b1 sweep ´(0 0 30))     -- b1 is now a solid body

Using sweep and swing to create a semi-circular sheet body from a minimum body which is then subsequently swung to form a hemisphere:

 

> (define b2 p_acorn)
> (b2 create)
> (b2 sweep ´(10 0 0))
> (b2 point ´(0 0 0); direction ´(0 0 1); angle 180)
> (b2 swing)         -- b2 is now a semi-circular sheet body
                     -- center at the origin, radius 10, arcing
                     -- from (10 0 0) to (-10 0 0)

> (b2 point ´(0 0 0); direction ´(1 0 0); angle 180)
> (b2 swing)
                     -- b2 is now a hemisphere, center at
                      -- the origin, radius 10 in positive Z

Some care has to be taken when creating a sheet body using sweep and swing on wire vertices. The example below has the same effect as the method shown above for creating a semi-circular sheet.

 

Note: Scribe must be the last function used, if the wire is to be closed, creating a body without geometry on the faces.

The function fix is finally used to attach a planar surface to one of the faces consisting of surfaces geometry.

 

> (define b3 p_acorn)
> (b3 create; direction ´(10 0 0); move)
> (b3 point ´(0 0 0 ); direction ´(0 0 1); angle 180; swing)
> (define n1 p_line)
> (n1 point ´(0 0 0 ); direction ´(-1 0 0); create)

> (define b4 p_bounded_curve)
> (b4 body ´b3; curve ´n1)
> (b4 startp ´(10 0 0 ); endp ´(-10 0 0 ))
> (b4 scribe)
> (define f1 face)
> (f1 pick_from ´b3)
> (f1 fix )                 -- planar surface fitted to face

[back to top]

6.6.1 Sweeping faces

Faces of sheet and solid bodies can both be swept.

 

> ( f0 sweep ´( 0 0 10 ) )

[back to top]


6.7 Hollowing, offsetting and imprinting

 

Object

Function

body

hollow, offset, imprint

[back to top]

6.7.1 Hollowing

hollow function

The function hollow creates a hollowed part from a solid body taking the single argument of the required wall thickness, (passing a negative distance causes the hollow to work outwards):

 

> ( b0 hollow 1 )         -- thickness of walls

This operation does not necessarily return a non-zero ifail in the event of a failure, it tries to return diagnostic information. Therefore, to make the hollow function fail when hollowing is unsuccessful, set the following option before attempting the operation:

 

> ( option raise_hollowing_errors t )

hollowing properties

Hollowing properties, when required, must be set on the body before the hollowing operation:

 

Property

Description

check_hollow

t or nil :

  • off and face checking translates to nil ,
  • full checking translates to t

pierce_faces

list of faces not to be offset

offset_faces

list of faces with specific offsets

tolerance

maximum applied tolerance

max_faults

maximum number of entities on badtaglist

pierce_faces function

An option parameter may be set to pierce some of the faces of the resulting body opening up the interior void.

Hollowing a body and opening up two faces:

 

> ( b0 pierce_faces ( f0 tag ))       -- faces to remove
> ( b0 hollow 0.1 )                   -- hollow & pierce

In the above example:

[back to top]

6.7.2 Offsetting

offset function

The offset function offsets the faces in a body by a specified distance:

 

> ( b0 offset 1 )       -- makes a bigger body
> ( b0 offset -1.5 )    -- makes a smaller body
> ( f0 offset 10 )      -- just do a faceset

 

Note: Since this exploits local operations, the offset distance must be small enough so that the topology of the body is not changed.

offsetting properties

Offsetting properties, when required, must be set on the body before the offsetting operation:

 

Property

Description

check_offset

t or nil :

  • off and face checking translates to nil ,
  • full checking translates to t

pierce_faces

list of faces not to be offset

offset_faces

list of faces with specific offsets

tolerance

maximum applied tolerance

max_faults

maximum number of entities on badtaglist

[back to top]

6.7.3 Imprinting

imprint function

The imprint function

 

> ( a imprint b)

works, where either of a or b are a faceset or a body.

 

[back to top]

<<< Creation of Primitives Chapters Local Operation Functions >>>