![]() |
Operations on Bodies, Curves, Surfaces, etc. |
<<< Creation of Primitives | Chapters | Local Operation Functions >>> |
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.
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.
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.
> (b1 check) -- check the body is valid |
> (b1 unite ´b2) -- b1 is now b1 + b2 (if required, b2 can be a list of bodies) |
> (b3 subtract ´b4) -- b3 is now b3 - b4 |
> (b5 intersect ´b6) -- b5 is now the intersecting volume |
Multiple tool bodies are supported in KID Booleans using:
> (b0 unite ´( b1 b2 )) > (b0 intersect ´( b1 b2 b3 )) > (b0 subtract ´( b1 b2 )) |
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 )
.
The single class consists of the topological items face, edge and vertex. The functions
merge
and
unfix
are inherited by these topological items.
merge
removes redundant faces, edges and vertices.
unfix
detaches, geometry from a face, edge or vertex.
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
.
> (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
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 |
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
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.
Properties for
rotate
are direction, point and angle, all are required.
Move a body a specified distance and 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 |
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.
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, when required, must be set before the blend is applied:
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:
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:
If c0, c1 and c2 are 1D B-curves (tags 29, 30, 31):
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) |
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. |
> (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) |
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
returns blend information.
> (e0 blend_enquire) -- information on unfixed blends on edge(s) e0 |
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
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 |
The
blend_fix
function fixes all unfixed blends on a specified body.
> (b0 blend_fix) -- all unfixed blends are fixed in body b0 |
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.
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 |
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 also works on sheet and wire bodies :
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 |
Many subclasses of the topology class can be modified with the functions
sweep
and
swing
.
The
sweep
function takes a vector as its argument.
The
swing
function takes as its arguments:
Using sweep to create a solid body from a minimum 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:
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.
Faces of sheet and solid bodies can both be swept.
> ( f0 sweep ´( 0 0 10 ) ) |
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, when required, must be set on the body before the hollowing operation:
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 |
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, when required, must be set on the body before the offsetting operation:
> ( a imprint b) |
works, where either of a or b are a faceset or a body.
<<< Creation of Primitives | Chapters | Local Operation Functions >>> |