Shadow Curves   

<<< Lofting Chapters Creating Emboss Features >>>

Contents

[back to top]


41.1 Introduction

You can use PK_BODY_imprint_cus_shadow to split the faces of a collection of bodies as necessary so that every face is either wholly visible or wholly invisible (including edge-on faces) when viewed from a specified view direction. Figure 41-1 shows the effect of doing this.

Possible uses of this functionality include (but are not limited to) rendering of shadow effects, picking, ray tracing, and more complex analysis of the profile of a part from a given view direction.

 

Note: This functionality does not support facet geometry.

 

Figure 41-1 Imprinting curves on a set of bodies to divide them into visible and invisible regions

 

Related Topics:

41.1.1 Received and returned arguments

This function receives the following arguments:

 

Received

Description

n_bodies

bodies

The bodies on which to imprint curves.

transfs

An array of length n_bodies containing transforms to apply to each corresponding body in bodies . The transforms can contain translation and rotation information, but not perspective.

If a given body does not need to be transformed, its corresponding entry in transfs may be PK_ENTITY_null.

If transfs is itself NULL, no transforms are applied to any of the supplied bodies.

view_direction

The view direction used to calculate the position of the imprinted curves.

options

A PK_BODY_imprint_cus_shadow_o_t structure containing a set of options: See Section 41.1.2, “Summary of options”, for more information

This function returns the following arguments:

 

Returned

Description

n_edges
edges

The set of edges representing the curves imprinted on the supplied bodies.

Only returned if want_edges in options is PK_LOGICAL_true.

n_visible_faces
visible_faces

The faces in the resulting body that are entirely visible. You need to return these faces if, for example, if you wish to distinguish visible faces from invisible faces when displaying them.

Only returned if want_visible_faces in options is PK_LOGICAL_true.

Each returned edge is created in one of two ways:

These are illustrated in Figure 41-2.

 

Figure 41-2 Creating edges from silhouette curves and overlapping face

41.1.2 Summary of options

The following table summarises the options that are available for PK_BODY_imprint_cus_shadow.

 

Option

Description

want_edges

Whether to return new edges. Default is PK_LOGICAL_false.

want_visible_faces

Whether to return visible faces. Default is PK_LOGICAL_false.

check_faces

Whether to check modified faces for faults. This option takes two values:

Note: It is recommended that you use PK_shadow_check_fa_yes_c. Use PK_shadow_check_fa_no_c if you wish to preserve old behaviour.

[back to top]

<<< Lofting Chapters Creating Emboss Features >>>