Rendering Option Settings   

<<< Rendering Functions Chapters Display Tolerances >>>

Contents

[back to top]


105.1 Introduction

The following chapter describes the various option settings of the rendering functions PK_GEOM_render and PK_TOPOL_render_line.

 

Related Topics:

[back to top]


105.2 PK_GEOM_render option settings

This section describes the options that you can set for PK_GEOM_render.

105.2.1 Boundary

 

Value

Description

PK_render_boundary_yes_c

render surface boundaries (Default)

PK_render_boundary_no_c

don't render surface boundaries

105.2.2 Param

 

Value

Description

PK_render_param_no_c

no parametric hatching (Default)

PK_render_param_attrib_c

apply parametric hatching to all faces which have a parametric hatch attribute set using the defined attribute values

PK_render_param_spaced_c

parametric hatching using param_u and param_v hatch values supplied with the options structure

PK_render_param_spaced_free_c

parametric hatching using param_u and param_v hatch values supplied without a fixed start parameter.

PK_render_param_number_free_c

parametric hatching with the number of u and v hatch lines supplied by param_u_number and param_v_number . and without a fixed start parameter.

The description of the PK_TOPOL_render_line options contains further information about parametric hatching with an example of parametric surface output. See Section 105.3.18, “Hatching” for more information.

105.2.3 Bcurve

 

Value

Description

PK_render_bcurve_polyline_c

output B-curves as polylines (Default)

PK_render_bcurve_bezier_c

output B-curves in Bezier form

PK_render_bcurve_nurbs_c

output B-curves in NURBS form

105.2.4 Lattice

 

Value

Description

PK_render_lattice_line_c

output each lattice rod as a straight line between 2 balls it connects (Default)

PK_render_lattice_solid_c

output each lattice ball as a sphere and each lattice rod as a cylindrical or conical segment between the 2 balls it connects.

PK_render_lattice_composite_c

output each lattice ball as a sphere and each lattice rod as a straight line between the 2 balls it connects.

If geoms contains a blended lattice and lattice is set to PK_render_lattice_solid_c then the lattice will be rendered as solid with the blends ignored. A Parasolid report of type PK_REPORT_record_type_3_c is generated with a status of PK_REPORT_3_render_lattice_c containing information on the blended lattices that have been rendered without blends.

See Chapter 11, “Using Reports”, for more information about the Parasolid Report mechanism.

[back to top]


105.3 PK_TOPOL_render_line option settings

This section describes the options that you can set for PK_TOPOL_render_line.

 

Note: This functionality offers partial support for facet geometry.

105.3.1 Edges

 

Value

Description

PK_render_edge_yes_c

Render edges (Default)

PK_render_edge_no_c

Do not render edges

By default, the edges of the model are always drawn.

The latter setting switches edge rendering off, allowing an application to generate view-dependent and view-independent graphics output data in separate calls to PK_TOPOL_render_line.

105.3.2 Silhouettes

 

Value

Description

PK_render_silhouette_no_c

Do not render silhouettes (Default)

PK_render_silhouette_yes_c

Render silhouettes

PK_render_silhouette_arcs_c

Render silhouettes, but detect near-circular silhouettes and render them as arcs

Each silhouette is assigned a unique label when it is constructed which is passed into GO.

If a hidden-line picture is required (implied by the visibility option setting), the silhouette option must be set to a value other than PK_render_silhouette_no_c.

The PK_render_silhouette_arcs_c setting is a specialised option used in drafting which allows dimensioned arcs to be identified. This slows down rendering and is not recommended for general use.

See Section 104.2.1, “Line types” for more information on silhouettes.

105.3.3 Silhouettes on meshes

The sil_mesh_normal_field option specifies whether silhouettes on faces with facet geometry are generated using either mvertex normals or mfacet normals.

 

Value

Description

PK_MESH_normal_field_mvertex_c

Use mesh vertex normals to generate silhouette curves (Default)

PK_MESH_normal_field_mfacet_c

Use mesh facet normals to generate silhouette curves

Silhouette curves generated using mvertex normals are smoother compared to those generated using mfacet normals, although they do not precisely follow the boundary between front-facing and back-facing facets. Figure 105-1 shows the difference in the silhouettes generated using either mvertex normals or mfacet normals.

 

Figure 105-1 Silhouettes generated using mvertex and mfacet normals

For more information on mfacet and mvertex normals, see Section 88.3, “Mesh normals”.

 

Note: This option is only available for bodies with facet geometry.

105.3.4 Sharp mfins

This option specifies whether to render sharp mfins on faces with facet geometry. You can use PK_MFIN_is_sharp to find out if a given mfin is sharp. See Section 88.3.2.4, “Finding sharp mfins in meshes” for more information on sharp mfins.

The sharp_mfins option takes the following values:

 

Value

Description

PK_render_sharp_mfins_no_c

Do not render sharp mfins (Default)

PK_render_sharp_mfins_yes_c

Render sharp mfins

When sharp_mfins is set to PK_render_sharp_mfins_yes_c, polylines that run along chains of connected sharp mfins will be rendered for every face that contains facet geometry. If the polyline lies along a silhouette, only the sharp mfin polyline is output. If an edge is coincident with a chain of sharp mfins, only the edge is output.

Figure 105-2 shows a single face body with a cube-shaped mesh attached with wire edges on the face. The wire edges on the face are partially coincident with a chain of sharp mfins therefore only the edge is output in the region of partial coincidence. See PK_TOPOL_render_line_o_t for more information on how sharp mfins are rendered.

For a list of the visibility codes that can be output by the GO, see Section 4.4.2.6, “Coincidence with sharp mfins” in the Downward Interfaces.

 

Figure 105-2 Rendering sharp mfins of a mesh cube

105.3.5 Visibility

A hidden-line drawing classifies all lines (edges, silhouettes and hatch lines) according to their visibility, which in turn depends on the view supplied. PK_TOPOL_render_line returns lines and associated visibility codes that represent the type of line returned (e.g., fully visible, hidden by a face, hidden by another edge etc.).

It is your decision as to how to render each type of line from your GO; Parasolid merely returns visibility codes and does not decide how the lines should appear. For example, you can opt to render all hidden lines in the same manner (regardless of what they are hidden by); or you may wish to exclude altogether those lines that are hidden by other lines, to avoid cluttering the diagram. The following table presents the values for the visibility option:

 

Value

Description

PK_render_vis_no_c

No visibility conditions evaluated: return all lines marked as visible.(Default)

PK_render_vis_hid_c

No hidden lines are returned.

PK_render_vis_inv_c

Hidden lines are returned and marked as invisible.

PK_render_vis_inv_draft_c

Hidden lines are returned and marked as invisible. A distinction is made between those hidden by other lines and those hidden by faces of the body.

PK_render_vis_extended_c

Evaluate visibility conditions and allow output to be controlled by the invisible , drafting and self_hidden options: see Sections 105.3.6, 105.3.7, and 105.3.8 respectively.

You can find a complete list of all the visibility codes that can be output by the GO in Section 4.4.2, “Line type”, of the Downward Interfaces manual.

 

Note: The PK_render_vis_inv_draft_c option cannot be used with a view transform entity whose underlying matrix has a perspective term.

Figure 105-3 and Figure 105-4 illustrate the effect of all of the visibility values except for PK_render_vis_extended_c.

 

Figure 105-3 A block with bosses, shown from two different directions

Figure 105-3 shows a block with two bosses, as seen from a standard three-dimensional view and also a two-dimensional plan view with view direction (0 0 1) (i.e., from below the object).

Figure 105-4 shows some sample hidden-line drawings based on what would be seen if you were looking at the object from the plan view shown in Figure 105-3(b), although the pictures are actually shown from the standard 3D view.

 

Figure 105-4 Rendering Figure 105-3 with different values of the visibility option

In diagram (a) above, all lines are rendered, as they are all marked as visible. Note that the silhouette lines for the upper boss are not rendered, because in the view direction (0, 0, 1) this boss has no silhouette. In diagram (b), no hidden lines are rendered, as they have not been returned by the function. In diagram (c), all lines are rendered but those that are hidden are displayed differently. The same is true in diagram (d), where an additional distinction between lines hidden by edges or faces is made.

 

Note: Where a line is obscured by both an edge and a face, as is the case with the uppermost circle in Figure 105-4 (d), it is treated as being hidden by an edge. In other words, being hidden by an edge takes precedence over being hidden behind a face.

The visibility option PK_render_vis_extended_c enables the invisible , drafting , and self_hidden options: see sections Section 105.3.6, “Invisible”, Section 105.3.7, “Drafting”, and Section 105.3.8, “Self-hidden” respectively. These let you specify more precisely how the GO data should differentiate between different cases of obscured lines. These three options are ignored if visibility is not set to PK_render_vis_extended_c.

When displaying hidden lines (using either PK_render_vis_inv_c, PK_render_vis_inv_draft_c, or PK_render_vis_inv_extended_c), you can prevent the display of hidden lines on specific bodies passed to PK_TOPOL_render_line. See Section 105.3.22, “Suppressing hidden lines in bodies in an assembly” for details.

105.3.6 Invisible

This option specifies whether invisible lines are output when visibility is set to PK_render_vis_extended_c.

 

Value

Description

PK_render_invisible_no_c

Do not output invisible lines.(Default)

PK_render_invisible_yes_c

Output invisible lines.

The resulting GO output is described in Section 105.3.22, “Suppressing hidden lines in bodies in an assembly” section.

When invisible is PK_render_invisible_yes_c, you can prevent the display of invisible lines on specific bodies passed to PK_TOPOL_render_line. See Section 105.3.22, “Suppressing hidden lines in bodies in an assembly” for details.

105.3.7 Drafting

This option determines whether or not a distinction is made between lines hidden by lines and lines hidden by faces when visibility is set to PK_render_vis_extended_c.

 

Value

Description

PK_render_drafting_no_c

Do not distinguish between lines hidden by other lines and lines hidden by faces (default).

PK_render_drafting_yes_c

Distinguish between lines hidden by other lines and lines hidden by faces.

The resulting GO output is described in Section 105.3.22, “Suppressing hidden lines in bodies in an assembly” section.

105.3.8 Self-hidden

This option is used to determine whether a distinction is made between lines hidden by faces of their own occurrence (i.e., from the same connected body) and lines hidden by faces of another occurrence (i.e., from a separate body or component of a disjoint body) when visibility is set to PK_render_vis_extended_c. Lines that are hidden by faces of their own occurrence are called self-hidden.

 

Value

Description

PK_render_self_hidden_no_c

Do not distinguish between self-hidden lines and other invisible lines.(Default)

PK_render_self_hidden_yes_c

Distinguish between self-hidden lines and other invisible lines.

Figure 105-5 shows the effect of each value of self_hidden , where invisible is PK_render_invisible_yes_c and drafting is PK_render_drafting_yes_c.

 

Note: Where a line is both self-hidden and obscured by faces from another occurrence, it is treated as being self-hidden. In other words, being self-hidden takes precedence over being invisible due to another occurrence.

 

Figure 105-5 The effect of the self_hidden option

105.3.9 Smoothness

The smooth option generates additional graphics output data which specifies whether an edge is “smooth”, “not smooth” or “smooth but coincident with a silhouette” (for view-dependent and hidden-line drawings only).

The value for smooth indicates whether the direction of the normal to the surface varies continuously across the edge or not. Examples of smooth edges are blend boundaries and edges which have been scribed onto a face.

If the option is not given, all edges are output with their smoothness code set “unknown” (CODUNS).

Although an implementation of GO may choose to ignore smooth edges, (those output with smoothness code CODSMO), it must draw ones classified as coincident with a silhouette (marked with code CODSMS) or gaps will occur in the drawing, where the obscured silhouette line was found.

 

Value

Description

PK_render_smooth_no_c

Don’t indicate whether edges are smooth. (Default)

PK_render_smooth_yes_c

Indicate whether edges are smooth.

PK_render_smooth_draft_c

Indicate whether edges are smooth, and also whether they are coincident with other lines.

The PK_render_smooth_draft_c setting is a specialized option which detects cases where smooth edges are coincident with lines (other than silhouettes) and reclassifies these before output through GO as being obscured by the faces of the smooth edge (i.e. tagged as CODDRV) rather than being obscured by the smooth edge itself.

The reason for the option is to provide support for implementations of GO which simply ignore smooth edges; it avoids the case where a smooth edge obscures part of another edge and ignoring it would cause gaps in the drawing.

There is no need to use the smoothness option if your GO does not use smoothness data.

105.3.10 Tolerance on smooth edges

You can use the following two options to specify a tolerance within which an edge is considered smooth:

 

Option

Description

is_edge_smooth_tol

If PK_LOGICAL_true, edge_smooth_tol defines the angular tolerance within which edges are deemed smooth.

If PK_LOGICAL_false, the angular tolerance used depends on the accuracy of the edge.(Default)

edge_smooth_tol

The angular tolerance (in radians) for smooth edges. An edge is considered smooth if the angle between the normals of the two faces that meet at the edge is less than edge_smooth_tol , as shown in Figure 105-6.(Default: 0.0)

 

Figure 105-6 Angular tolerance for smooth edges

105.3.11 Output of internal edges

The internal option is used to specify whether to indicate internal edges, i.e. where faces on either side of the edge lie on the same surface.

 

Value

Description

PK_render_internal_no_c

Do not indicate whether edges are internal edges (Default).

PK_render_internal_yes_c

Indicate whether edges are internal edges.

If the internal option is set to PK_render_internal_no_c, the GO data is output with the internal edge value set to ‘unknown’ (CODINU). If it is set to PK_render_internal_yes_c, Parasolid will calculate and output whether the edges are:

The application can decide whether to suppress drawing these edges.

105.3.12 Sketching bodies that have missing geometry

You can use the ske_missing option (PK_render_ske_missing_t) in PK_TOPOL_render_line to control whether Parasolid attempts to render bodies that have missing geometry information. Generally, rendering is best performed on bodies whose geometry is completely specified. However, there may be times - for example if you are attempting to work with model data that has been imported from another source - when it is useful to be able to visualise a body that has missing information.

The ske_missing option takes the following values:

 

Value

Description

PK_render_ske_missing_no_c

Return an error if any of the entities in the body to be rendered are missing geometry. (Default)

PK_render_ske_missing_yes_c

Ignore entities with missing geometry and continue to sketch other entities.

  • Any edges that have missing geometry are not rendered.
  • If silhouettes or hatch lines have been requested, these are omitted for any faces that have missing edge or surface geometry.

 

Note: This option is only valid for wire-frame sketches; that is, when visibility has its default value of PK_render_vis_no_c.

105.3.13 Ignoring small features

This option allows small features to be ignored, where a small feature is a set of connected faces whose box is smaller than a user-specified value. The small feature is replaced by a loop of edges which indicates the position of the boundary between the small feature and the model. These loops are either completely visible or invisible (see Figure 105-7).

 

Note: For this option to take effect, the visibility must not be set to PK_render_vis_no_c. See Section 105.3.22.

The options available for ignore are:

 

Value

Description

PK_render_ignore_no_c

no features are ignored (Default)

PK_render_ignore_absolute_c

input an absolute value

PK_render_ignore_ratio_c

input the ratio of feature to body box

If ignore is set to PK_render_ignore_absolute_c then any feature whose size box is smaller than this value is ignored. If ignore is set to PK_render_ignore_ratio_c then the value input corresponds to the ratio of the feature box size to the size of the box containing the model, i.e. if this value is set to 0.01 then a feature is ignored if its box is smaller than 1% of the model’s box.

Not all small features are ignored. This is determined by the position of the boundary between the small feature and the rest of the model, only if this boundary lies completely within a face of the model is the small feature ignored.

In the left-hand illustration of Figure 105-7 the boundaries of the small features lie completely within another face in the model. These features are replaced by a loop of edges indicating where the features lie on the model. Each edge in these loops is still output, but is labelled with the code ‘CODIGN’ where it would normally have its ‘internal’ property output. See PK_GOSGMT_f_t, in the PK Interface Programming Reference Manual for information about CODIGN.

In the right-hand illustration of Figure 105-7 the boundaries of the small features lie across the boundary of two faces. These features cannot be ignored.

 

Figure 105-7 Ignoring small features - demonstrating small features that can be ignored and those that cannot.

105.3.14 Hierarchical output

The hierarchical output option can be used when rendering a hidden-line drawing. It specifies that edges/silhouettes/hatch lines must be output through GO hierarchically, consisting of two calls to GOSGMT, enclosed by a pair calls to GOOPSG and GOCLSG.

The first call to GOSGMT defines the line segment type and its geometry.

The second call to GOSGMT defines a “visibility segment” (SGTPVP), specifying points at which the segment visibility or smoothness changes and the visibility codes for edges/silhouettes/hatch line between these points.

If geometry is being output in polyline form, there is an option which outputs an additional parameter with each visibility transition point corresponding to its position along the polyline.

 

Value

Description

PK_render_hierarch_no_c

do not produce hierarchical output (Default)

PK_render_hierarch_no_geom_c

do not output geometry segments, but do output visibility segment data

PK_render_hierarch_yes_c

output geometry segments and output visibility segment data

PK_render_hierarch_param_c

output geometry segments and output visibility segment data with polyline parameterisation

The PK_render_hierarch_no_geom_c option can only be used if the segment geometry has been output in an earlier call to PK_TOPOL_render_line and has been stored by the application.

See Section 4.3.1, “Segment hierarchy” in the Downward Interfaces manual for more information.

105.3.15 B-Curve format

This option specifies which format is used by the graphics output functions to output rendering data for B-curves. This applies to B-curves which are defined in the model and to derived B-curves such as hatch and boundary lines on B-surfaces.

Curves are output in rational or non-rational form; depending on the order of the original curve or surface from which is was derived.

 

Value

Description

PK_render_bcurve_polyline_c

output B-curves as polylines (default)

PK_render_bcurve_bezier_c

output B-curves in Bezier form

PK_render_bcurve_nurbs_c

output B-curves in NURBS form

See Appendix B, “The Mathematical Form Of B-Geometry” for further information.

105.3.16 Controlling memory usage

You can let your application have a degree of control over the amount of system resources during hidden-line operations using the memory_target and memory_target_value options for PK_TOPOL_render_line. These options let you specify a peak memory value that Parasolid attempts to keep within during the call to PK_TOPOL_render_line.

Controlling memory usage during hidden-line operations can be useful for:

Although this technique results in an increase in total processor time, in certain cases it can result in a decrease in the elapsed (real) time taken to render the assembly.

Parasolid does not guarantee to meet the specified target.

 

Option

Description

memory_target

Whether to keep memory usage within a specified value. This can be one of:

memory_target_value

A target value, in bytes, that Parasolid attempts to keep memory usage within during the call to PK_TOPOL_render_line.(Default:0)

 

Note: For this option to take effect, the visibility must not be set to PK_render_vis_no_c. See Section 105.3.22, “Suppressing hidden lines in bodies in an assembly”.

Using this option can bring varying degrees of success, depending on the target you specify, the resources available on the machine, and the size of the assembly that you are rendering. Different memory targets and different assemblies may yield improvements in memory usage, or elapsed time taken to render, or both.

Your application could typically follow these steps in order to calculate a suitable target memory value:

For large assemblies, a memory target in the region of 100MB may be possible, regardless of the original memory requirement. Using this option may let you render some assemblies successfully that would otherwise be impossible to display.

 

Note: Parasolid does not place any restrictions on the memory target that you specify, and your application should perform any necessary checks for unreasonable limits that could cause a drastic degradation in performance.

105.3.17 Reporting line fit failures

You can use the report_lines option to report whether there are any model curves to which Parasolid could not fit polylines during rendering. This takes the following values:

 

Value

Description

PK_render_report_line_no_c

Report nothing (Default)

PK_render_report_line_fail_c

Report all line fits that have failed

PK_render_report_line_loose_c

Report line fits that have succeeded using looser tolerances

PK_render_report_line_all_c

Report line fits that have failed, and line fits that have succeeded using looser tolerances

If report_lines is set to any of the above values except PK_render_report_line_no_c, a Parasolid Report of type PK_REPORT_record_type_3_c is generated with a status of PK_REPORT_3_line_fit_tols_c and returns information for curves where the line fit has failed.

See Chapter 11, “Using Reports”, for more information about the Parasolid Report mechanism.

105.3.18 Hatching

Parasolid supports planar hatching, radial hatching and parametric hatching.

Planar hatching can be expensive to calculate for some types of surface, hence the other, surface-specific types of hatching.

When constructing hidden-line drawings, hatch lines are classified as visible/invisible in a similar way as used when drawing the model edges.

105.3.18.1 Planar hatching

Planar hatching instructs the function to output lines representing the intersections of a face with a family of equally spaced parallel planes.

 

Value

Description

PK_render_planar_no_c

Do not apply planar hatching.(Default)

PK_render_planar_attrib_c

Apply planar hatching to planar faces that have a hatch attribute set using the defined attribute values. You can apply more than one planar hatch to a face, depending on the information in the attached attribute. See Section A.3.5.2, “Parametric hatch”, for more details.

PK_render_planar_free_c

Apply planar hatching to all planar faces using the planar_spacing value and axis field of planar_axis supplied with the options structure for the hatch direction.

PK_render_planar_yes_c

Apply planar hatching to all planar faces using the planar_hatching value and both the axis and location fields of planar_axis supplied with the options structure for the hatch direction and location of the base hatching plane.

The planar_hatching value defines the hatch spacing in model units.

The axis field of planar_axis specifies the normal direction of hatch planes.

The location field of planar_axis defines a point on one of the hatching planes which allows the application to control the relative position of hatch lines on a face. This option allows the application to simulate more complex hatch spacing by varying the location and calling PK_TOPOL_render_line multiple times.

The PK_render_planar_free_c option specifies that Parasolid should choose the start position for hatching.

 

Figure 105-8 Planar hatching (both cubes drawn with PK_TOPOL_render_line)

105.3.18.2 Radial hatching

Radial hatching is used on cylindrical, spherical, conical, toroidal and blending faces (described below as radial faces).

The radial hatching parameters allow cross-hatching of faces to be specified, such as producing lines both along and around a cylinder.

 

Value

Description

PK_render_radial_no_c

no radial hatching (Default)

PK_render_radial_attrib_c

apply radial hatching to radial faces which have a hatch attribute set using the defined attribute values

PK_render_radial_free_c

apply radial hatching to all radial faces using some/all of the floating point values supplied in the options structure as detailed below (Parasolid chooses the starting values):

  • radial_around angular spacing around spine (Default: 0.0)
  • radial_along spacing in model units along spine (Default: 0.0)
  • radial_about angular spacing about the center (Default: 0.0)

PK_render_radial_yes_c

apply radial hatching to all radial faces using some/all of the floating point values supplied in the options structure as above; to specify starting values for hatching, see options below (if none are supplied PK_render_radial_yes_c behaves like PK_render_radial_free_c with Parasolid choosing the starting values):

  • radial_around_start parameter value for first hatch line around spine (Default: PK_TOPOL_render_value_null)
  • radial_along_start starting value for spacing in model units along spine (Default: PK_TOPOL_render_value_null)
  • radial_about_start parameter value for first hatch line about the center (Default: PK_TOPOL_render_value_null)

The initialised values of zero imply that hatching is not required in a particular direction (the full meaning depending on the surface types).

 

Figure 105-9 Radial hatching using radial_around = pi/2 to control vertical hatch lines and radial_along = 7 to control the spacing between the circular hatch lines

 

Figure 105-10 Radial hatch (using the same option data as Figure 105-9)

The hatched torus looks messy using this value of radial_along to control the spacing between the circles centered on the spline.

If we use the radial_about value instead, to control this spacing by giving an angle to use between the planes which produce these intersection circles, it is much easier to control what happens.

 

Figure 105-11 Radial hatching using all three data options

Cylindrical and conical surfaces

The interpretation of different radial values for cylindrical and conical surfaces is as follows:

 

Value

Description

radial_around

controls the spacing of straight hatch lines running along the surface parallel to the axis, as would be generated by a plane rotating in steps about the axis by the given angle (which must be in the range 0 to two pi)

radial_along

controls the spacing of circular hatch lines running around the surface perpendicular to the axis, as would be generated by a plane stepping along the axis by the given distance

radial_about

not significant

radial_around_start

measured from the ref_direction of the cylindrical basis set

radial_along_start

measured from a plane defined by the location and the axis as specified in the basis set

radial_about_start

not significant

Spherical surfaces

The interpretation of different radial values for spherical surfaces is as follows:

 

Value

Description

radial_around

controls the spacing of the longitudinal hatch lines, as would be generated by a plane rotating by the given angle about the axis of the surface (which must be in the range 0 to two pi)

radial_along

not significant

radial_about

controls the spacing of the latitudinal hatch lines, as would be generated by a cone (apex at center of surface, axis parallel to surface axis) whose half angle is incremented by the given value (which must be in the range 0 to two pi)

radial_around_start

measured from the ref_direction

radial_along_start

not significant

radial_about_start

measured from the ref_direction

Toroidal surfaces

The interpretation of different radial values for toroidal surfaces is as follows:

 

Value

Description

radial_around

controls the spacing of circular hatch lines centered on the axis of the torus, as would be generated by a cone (axis parallel to torus axis, passing through spine of torus) whose half angle is incremented by the given value, which must be in the range 0 to two pi

radial_along

controls the spacing of circular hatch lines centered on the spine of the torus, as would be generated by a plane rotating about the axis of the torus (see radial_along specifies a distance along the spine; radial_about specifies an angle about the axis.” below)

radial_about

controls the spacing of circular hatch lines centered on the spine of the torus, as would be generated by a plane rotating about the axis of the torus (see radial_along specifies a distance along the spine; radial_about specifies an angle about the axis.” below)

radial_around_start

all measured from the ref_direction

radial_about_start
radial_along_start

 

Note: radial_along specifies a distance along the spine; radial_about specifies an angle about the axis.

If both radial_along and radial_about are non-zero, the latter is used. If a value is given for radial_about , it must be in the range 0 to two pi.

Edge-blend surfaces

The interpretation of different radial values for edge-blend surfaces is as follows:

 

Value

Description

radial_along

controls the spacing of circular hatch lines running around the surface perpendicular to its spine, equivalent to the circles generated by this value for cylindrical surfaces (as would be generated by a plane stepping along the surface spine by the given distance)

radial_around

not significant

radial_about

not significant

radial_along_start

the parameter of the spine curve returned from PK_BLENDSF_ask

radial_around_start

not significant

radial_about_start

not significant

105.3.18.3 Parametric hatching

Parametric hatching instructs the function to output data corresponding to parametric hatch lines.

 

Value

Description

PK_render_param_no_c

no parametric hatching (Default)

PK_render_param_attrib_c

apply parametric hatching to any faces which have a hatch attribute set using the defined attribute values

PK_render_param_spaced_free_c

parametric hatching using param_u and param_v hatch spacing supplied with the options structure below (Parasolid chooses the starting values):

  • param_u hatch spacing in u direction (default 0.0)
  • param_v hatch spacing in v direction (default 0.0)

PK_render_param_spaced_c

parametric hatching using param_u and param_v hatch spacing supplied with the options structure as detailed in PK_render_param_spaced_free_c and with the starting values for hatching specified as follows:

  • param_u_start starting value for hatch spacing in u direction
  • param_v_start starting value for hatch spacing in v direction
Note: If no starting values are supplied or if PK_render_param_spaced_c is set using PK_GEOM_render_o_t , it will behave like PK_render_param_spaced_free_c with Parasolid choosing the starting values.

PK_render_param_number_free_c

parametric hatching using param_u_number and param_v_number hatch numbering with the options structure as follows:

  • param_u_number number of hatch lines in the u direction hatch
  • param_v_number number of hatch lines in the v direction hatch

Parametric hatch lines can be output on any type of surface. The lines output are the locus of points of constant parameter on the equivalent B-surface.

 

Figure 105-12 Parametric hatching

On faces, the spacing starts at the low parameters of the parameter box of the faces, as returned by PK_FACE_find_uvbox.

 

Note: It is not possible to output constant v parameter curves on blend surfaces.

105.3.19 Unfixed blends

This option is only available when drawing view-independent topology.

It instructs the rendering function to draw unfixed blends as they would appear when fixed.

If the entities being drawn are bodies or edges, an unfixed edge is not output directly. Instead the edges of the faces adjacent to the edge are clipped and rib lines are added at each end of and possibly along the spine of the unfixed blending edge.

If an unfixed blended edge is drawn in isolation, no other graphical information about the attached faces is output.

The parameters of an unfixed blend are held as a blended attributes. These describe the start and end radii and possibly a specific rib spacing distance to use when the unfixed blend is drawn.

105.3.19.1 Options

 

Value

Description

PK_render_unfix_no_c

no rendering of unfixed blends (Default), i.e. unfixed blends are simply drawn by their edges

PK_render_unfix_attrib_c

render all unfixed blends, using the values held with their blending attribute to determine whether blend boundaries and rib lines are drawn

PK_render_unfix_yes_c

render all unfixed blends (if the unfix_spacing value in the options structure is zero, just draw the boundaries of the unfixed blends; if the unfix_spacing value in the options structure is non-zero, draw the rib lines as well, all using the value as the rib separation distance)

 

Warning: Unfixed blends cannot be specified in a view-dependent or hidden-line drawing.

 

Figure 105-13 Unfixed blends, drawn with and without surrounding edges

105.3.20 Overlapping bodies

Parasolid allows assemblies and lists of bodies that overlap in model space to be rendered with hidden lines such that the results are predictable and stable. Where the edges and silhouettes of one body intersect with the face of another, those lines are trimmed to the intersecting face. New intersection curves can also be generated, although this does incur a performance overhead. In these cases, however, the overhead can be minimised if you know which bodies are likely to overlap.

 

Note: For any overlapping options to take effect, the visibility must not be set to PK_render_vis_no_c. See Section 105.3.22.

The values available for the overlap field are:

 

Value

Description

PK_render_overlap_no_c

Do not allow for overlapping bodies (Default). Parasolid assumes that the bodies being rendered do not overlap. If there are overlapping bodies present then these are not detected and the resulting picture may contain errors; you must set overlap to a non-default value to render the assembly correctly.

PK_render_overlap_yes_c

Parasolid detects the presence of overlapping bodies and splits the existing lines appropriately. However, no new curves or edges are generated.

Using this option incurs a performance overhead compared to PK_render_overlap_no_c.

PK_render_overlap_intsec_all_c

Parasolid detects the presence of overlapping bodies and splits the existing lines appropriately. It also generates new intersection curves where the bodies intersect, and the corresponding edges on the intersecting faces. Juxtaposed bodies (those that do not have well-defined interference curves) are displayed as they would be using PK_render_overlap_yes_c.

The use of this option incurs an additional performance overhead compared to PK_render_overlap_yes_c. This can be reduced if you know which bodies might overlap, as you can instruct Parasolid to ignore the remaining bodies.

PK_render_overlap_intsec_pair_c

This option has the same effect as PK_render_overlap_intsec_all_c but uses a different method to compare potentially overlapping bodies. It also incurs an additional performance overhead compared to PK_render_overlap_yes_c.

Figure 105-14 demonstrates the effect of each of these settings on a rendered image. It shows a cylinder passing through a cylindrical hole drilled in a block; the diameter of the cylinder being slightly larger than the diameter of the hole so that the cylinder and the block overlap.

 

Figure 105-14 Overlapping bodies: demonstrating the effect of the overlap option on a rendered image

In Figure 105-14, when overlap is set to PK_render_overlap_no_c, Parasolid does not detect that the silhouettes of the cylinder intersect the block and they are not output with the correct visibility.

When overlap is set to PK_render_overlap_yes_c, the silhouettes of the cylinder are intersected with the face and rendered correctly.

When overlap is set to PK_render_overlap_intsec_all_c or PK_render_overlap_intsec_pair_c, the silhouettes of the cylinder are intersected with the face and rendered correctly, with new edges generated where the faces of the overlapping bodies intersect.

When generating new intersection curves and edges, if you know which bodies are likely to overlap, you can optimise the performance of Parasolid by using the overlap_indices1 and overlap_indices2 arrays. These arrays take indices of specific bodies in the topols array (as passed to PK_TOPOL_render_line), enabling you to restrict the checks performed by overlap to just these bodies. The following table describes the combinations available, depending on the value of overlap :

 

Value of overlap

Content of overlap_indices* arrays

Action taken

PK_render_overlap_intsec_all_c

Both overlap_indices1 and overlap_indices2 are NULL (the default value).

Each body will be checked against all others for clashes.

One of overlap_indices1 and overlap_indices2 is NULL but the other is not.

Each body indexed in the non-empty array will be checked against all others in this array.

Both overlap_indices1 and overlap_indices2 contain indices of bodies.

Each body indexed in the first array will be checked against all bodies indexed in the second.

PK_render_overlap_intsec_pair_c

Both overlap_indices1 and overlap_indices2 contain indices of bodies. These arrays must be the same size.

For example, if

overlap_indices2 = [1 3 4] and overlap_indices2 = [2 7 8] ,

the following pairs of bodies are checked: topols[1] with topols[2] , topols[3] with topols[7] and topols[4] with topols[8] .

Pairs of bodies indexed by corresponding entries in each array will be checked for clashes.

105.3.21 Transparency

Bodies can be rendered so that they appear transparent, such that they do not hide other bodies, as shown in Figure 105-15.

 

Figure 105-15 A transparent cube with cylindrical hole between two solid cubes

If a body is rendered as transparent it will not hide its own lines, and will not hide the lines of other bodies, as shown in Figure 105-16.

 

Figure 105-16 Hidden lines when rendering a wire body as transparent, viewed in front of a solid body

There are two ways that a body can be rendered transparent:

You can choose which of the above methods is used using the transparency option in PK_TOPOL_render_line_o_t, which takes the following values:

 

Value

Description

PK_render_transparent_yes_c

A body is rendered transparent if it has an associated attribute of type SDL/TYSA_TRANSPARENCY, with a non-zero transparency coefficient.

PK_render_transparent_no_c

All bodies are rendered opaque whether or not they have an associated transparency attribute. This is the default.

PK_render_transparent_index_c

An occurrence of a body is rendered transparent if the transparent_indices array contains an index to it, regardless of whether it has an associated transparency attribute.

If this value is used, any transparency attributes attached to bodies are ignored.

The transparent_indices array contains the index values of body occurrences that you want to render transparent, according to the position of those occurrences in the topols array. For instance, if you want to render transparent the body occurrences that are in the first, third, and fourth positions of the topols array, transparent_indices should be (0, 2, 3). In this case, n_transparent_indices is 3.

You can also use the transparent_hid option to control how transparent entities are rendered. By default, transparent entities are rendered as transparent, as shown in Figure 105-15. However, if transparent_hid is set to PK_render_transp_hid_yes_c, transparent entities are rendered as opaque relative to themselves and other transparent bodies, but transparent relative to non-transparent bodies. Figure 105-17 demonstrates this setting: the transparent body is drawn as opaque relative to itself (you cannot see its own hidden lines), but transparent with respect to the non-transparent body behind it.

 

Figure 105-17 Rendering transparent bodies as opaque

105.3.22 Suppressing hidden lines in bodies in an assembly

If you are rendering a hidden-line view containing several bodies, you can switch off hidden-line display for specific bodies. This can have benefits in terms of:

You can prevent hidden lines in specific bodies using the suppressed_indices option. This is a list of indices into the topols passed to PK_TOPOL_render_line that indicates which bodies should have no hidden lines.

For example, if three bodies are passed as topols , and you want to suppress hidden lines in the first and third of these, set suppressed_indices to [0 2] , and the accompanying n_suppressed_indices option to 2 .

Figure 105-18 shows an example in which a total of six bodies are rendered using the view direction shown.

 

Figure 105-18 Suppressing hidden-line display in specific bodies in an assembly

 

Note: You can only use this option if visibility is one of the following values:

See Section 105.3.22, “Suppressing hidden lines in bodies in an assembly”, for more details.

105.3.23 Using viewports to render specific entities

Parasolid lets you specify one or more viewports - discrete volumes of three-dimensional space - so that you can control which entities in a body are rendered. This is a particularly useful way of improving rendering performance in cases where you are performing modelling operations on a large body that only change a small number of entities, or entities in a discrete part of the body: by specifying a viewport, only the entities that are inside that viewport are re-rendered.

Parasolid lets you specify:

This section describes how to use viewports to render large bodies efficiently.

105.3.23.1 Using single or multiple viewports

Generally when you use viewport functionality, you only want to specify a single viewport. Sometimes, however, it might be useful to use several viewports in a single call to PK_TOPOL_render_line; if, for instance, you want to re-render discrete changes in different components of a disjoint body.

You use the viewport option in PK_TOPOL_render_line_o_t to specify whether to use single or multiple viewports. This takes the following values:

 

Value

Description

PK_render_viewport_no_c

Do not use viewports. (Default)

PK_render_viewport_yes_c

Use a single viewport. Entities that are outside the specified viewport are omitted when rendering.

PK_render_viewport_array_c

Use multiple viewports. Multiple viewports are provided as an array. Entities that are outside all the specified viewports are omitted when rendering.

A single viewport is specified using the viewport_sf option. This takes a standard form for a single non-aligned box.

When multiple viewports are used, viewport_sf is ignored, and the viewports are specified using the following options:

 

Option

Description

n_viewports

The number of viewports you are specifying. This should be an integer greater than zero if you have specified multiple viewports. (Default:0)

viewports

An array of viewports. Each viewport is specified using the standard form for a single non-aligned box.(Default: NULL)

 

    Performance issue: In general, a single viewport yields better performance compared to multiple viewports that render an equivalent number of lines. As the number of viewports increases, the complexity of any rendering operation also increases, leading to a decrease in performance. In particular, multiple viewports that overlap, or are close to each other in 3D space, are likely to yield less efficient results.

105.3.23.2 Types of viewport

Whether you use a single viewport or multiple viewports, Parasolid supports two different kinds of viewport: 3D and 2D viewports. Both of these are defined using a non-aligned box (PK_NABOX_sf_t).

You use the viewport_type option to specify the type of viewport. The default type of viewport is 3D (PK_render_viewport_type_3D_c).

 

Type of viewport

Notes

A 3D viewport is a cuboid region of world space.

The orientation of the viewport is derived from the local axes of the non-aligned box.

  • The ref_direction and axis of the non-aligned box’s basis_set define the x and z axes of the viewport respectively.
  • The y axis is calculated from the cross product of these axes.

The size of the viewport is derived from the box defined in the PK_NABOX_sf_t. This structure specifies intervals on the x, y, and z axes that define the size of the viewport itself.

A 2D viewport is a rectangular window through which world space can be viewed along a specified view direction.

The view direction for the viewport is taken from the z axis of the non-aligned box, as defined using the axis structure of the non-aligned box’s basis_set . This must be coincident with the view_transf argument received by PK_TOPOL_render_line.

The window of the viewport is derived from the x and y axes of the non-aligned box:

  • The ref_direction of the non-aligned box’s basis_set defines the x axis.
  • The y axis is calculated from the cross product of the z and x axes.

The size of the window is taken from the first 4 coordinates of the box defined in the PK_NABOX_sf_t. This structure specifies intervals on the x and y axes that define the size of the window itself.

Figure 105-19 illustrates the differences between typical 3D and 2D viewports onto a body; these viewports could be specified using the same non-aligned box.

 

Figure 105-19 Specifying 2D and 3D viewports on a body

 

Note: If you specify multiple viewports, then they must all be either 2D or 3D: you cannot mix the two types.

105.3.23.3 Clipping entities to viewport boundaries

Usually, some entities in a body cross the boundary of a viewport; they are not entirely contained within the definition of the viewport itself. Parasolid provides the viewport_clipping option to let you control whether such entities are completely rendered, or whether the rendering is clipped to the boundary of the viewport itself. The viewport_clipping option takes the following values:

 

Value

Description

PK_render_viewport_clip_no_c

Do not provide clipping information for the rendering operation. For any face that clashes with the specified viewport, all curve data associated with entities belonging to that face are rendered. (Default)

PK_render_viewport_clip_yes_c

Note: Provide clipping information for the rendering operation. Curve data that lie outside the specified viewport are marked as being outside the viewport and no visibility information is provided. See Section 4.4.2, “Line type”, in the Downward Interfaces manual for more information.

Note: If you are using a 3D viewport, any clashes between rendering faces and viewport faces will result in the generation of a clip line.

Using the same viewports and body illustrated in Figure 105-19, Figure 105-20 shows the entities that are returned for a 3D viewport when clipping is on or off (clip lines are shown in green), and Figure 105-21 shows the entities returned for a 2D viewport when clipping is on or off.

 

Figure 105-20 Clipping a 3D viewport

 

Figure 105-21 Clipping a 2D viewport

105.3.24 Regional data

The region option can be used when rendering a hidden-line drawing. It generates additional graphics output data which allows your application to analyse the projected (2-dimensional) hidden-line picture into distinct regions and link up the boundaries of the regions appropriately.

There is no need to use this option if your GO does not use such regional data. The region option takes the following values:

 

Value

Description

PK_render_region_no_c

Do not output regional data.(Default)

PK_render_region_attrib_c

Output regional data for lines bounding faces that have the SDL/TYSA_REGION system attribute set. See Section A.4.4, “Region”, for information about this attribute.

PK_render_region_yes_c

Output regional data for all boundary lines.

Regional data is attached to all boundary line segments, that is, to edge, silhouette, interference, and clip segments, and is output as follows:

When the hidden-line picture is projected into two dimensions, the lines divide the plane into distinct regions, as shown in Figure 105-22.

 

Figure 105-22 Regional data - hidden-line picture

 

Note: For simplicity, Figure 105-22 shows an example of how a line projected from a single edge (highlighted) is split at intersection points. In reality, lines projected from every edge in the body are split in this way.

For each region that derives from a face, the lines whose projections in the plane bound the region are all output with regional data. This data indicates which points in the image bound the line, and which faces are on each side of the line. Your application can then construct the loops and regions of the image. If region is PK_render_region_attrib_c, then regional data is only output for lines bounding regions that derive from faces that have a SDL/TYSA_REGION attribute attached.

For information about how regional data is output, see Section 4.5, “Interpreting regional data”, in the Downward Interfaces manual.

 

[back to top]

<<< Rendering Functions Chapters Display Tolerances >>>