Graphical Output Functions   

<<< Frustrum Functions Chapters PK_DELTA Functions >>>

Contents

[back to top]


B.1 Introduction

This appendix contains the specifications of the Graphical Output functions; these render graphical data generated by the PK line drawing functions:

[back to top]


B.2 GOSGMT - output non hierarchical segment

 

void GOSGMT
(
                      /* received arguments                */
const int    *segtyp, /* type (SGTPED, SGTPSI, SGTPPH...)  */
const int    *ntags,  /* size of tag array                 */
const int    *tags,   /* tags associated with segment      */
const int    *ngeom,  /* size of geom array                */
const double *geom,   /* geometry of segment               */
const int    *nlntp,  /* size of line type array           */
const int    *lntp,   /* occ num, geom type, smoothness... */
                      /* returned arguments                */
int          *ifail   /* failure code: CONTIN or ABORT     */
)

The arguments have the following significance.

segtyp

The type of the segment; one of the following values:

 

SGTPED

2006

Edge

SGTPSI

2007

Silhouette line

SGTPPH

2008

Planar hatch-line

SGTPRH

2009

Radial hatch-line

SGTPRU

2010

Rib line (unfixed blend)

SGTPBB

2011

Blend-boundary line

SGTPPL

2012

Parametric hatch line

SGTPFT

2016

Facet

SGTPER

2018

Error segment

SGTPGC

2019

Geometry ... curve

SGTPGS

2020

Geometry ... surface

SGTPGB

2021

Geometry ... surface boundary

SGTPMF

2022

Mangled facet

SGTPVT

2023

Visibility segment (used for hierarchical output)

SGTPTS

2024

Facet strip

SGTPVP

2025

Parametrised Visibility segment

ntags, tags

An array of tags associated with the segment. The tags given depend upon the segment type as follows:

 

SGTPED

tag of edge (or none if edge output hierarchically)

SGTPSI
SGTPPH
SGTPRH

tag of face on which silhouette or hatch line lies
(or none if silhouette or hatch line output hierarchically)

SGTPRU
SGTPBB

tag of edge blended

SGTPPL

tag of face or surface on which parametric hatch line lies
(or none if hatchline output hierarchically)

SGTPFT

tag of face on which facet lies

SGTPER

tag of entity which could not be rendered

SGTPGC

tag of the curve

SGTPGS

tag of the surface

SGTPGB

tag of the surface for which this is a boundary curve

SGTPMF

tag of face on which mangled facet lies

SGTPVT

none

SGTPTS

tag of face on which facet strip lies

SGTPVP

none

If edges, silhouettes or hatchlines are output hierarchically then the tag information is given by GOOPSG and GOCLSG.

When rendering a list of entities Parasolid may encounter a body, face or edge which it is unable to render (e.g. a rubber face). In such a case, Parasolid outputs an error segment (SGTPER), giving the tag of the bad entity and a code indicating why it was unable to render it, and then continue to render the remaining entities.

If user tolerances can't be matched during faceting, or facets are created which self intersect or are severely creased, then geometric data is output as a segment type SGTPMF. In this case, the facets are always triangular.

This does not apply to geometry (i.e. SGTPGC, SGTPGS and SGTPGB). These are never replaced by error segments, unrenderable geometry segments are not output at all.

If edges/silhouettes/hatchlines are being output hierarchically then GOSGMT is called to output the whole geometry of the item (optional) and again to output the positions at which the visibility changes on the item (a visibility segment).

If regional data was requested in a hidden line drawing two further tags are given for SGTPED and SGTPSI segments, identifying the faces either side of the line in the image. Either or both face tags may be null.

If edge tags were requested in a faceted drawing, for each edge of the facet the tag of the model edge from which it was derived is given; or a null tag if it is not derived from a model edge. The number of edge tags given equals the number of vertices given in geom . The first edge tag ( tags[1] ) is the tag of the edge from which is derived the first facet edge (which ends at the first vertex given in geom ). The second edge tag is for the facet edge which ends at the second vertex, and so on.

If facet strips have been requested in a faceted drawing the format for the edge tags is as follows:

ngeom, geom

An array of reals giving the geometry of the segment.

The values given depend upon the type of the geometry, as specified in the second element of lntp .

L3TPSL - straight line: ngeom = 9

L3TPCC - complete circle: ngeom = 7

The forward direction of the circle is clockwise when viewing the circle along the axis direction.

L3TPCI - circular arc: ngeom = 13

The forward direction of the circle is as given above.

L3TPCE - complete ellipse: ngeom = 11

The forward direction of the ellipse is clockwise when viewing the ellipse along the axis direction. The axis direction is the vector cross product of the major axis with the minor axis in that order.

L3TPEL - elliptical arc: ngeom = 17

The forward direction of the ellipse is as given above.

L3TPPY - poly line:

geom holds ngeom vectors.

L3TPPC - non-rational B-curve in Bezier form:

geom holds ngeom vectors of dimension 3.

These are the Bezier vertices of the curve.

L3TPRC - rational B-curve in Bezier form:

geom holds ngeom vectors of dimension 4.

These are the Bezier vertices of the curve, where each Bezier vertex consists of a 3-space point and a weight.

L3TPNC - non-rational B-curve in NURBs form:

geom holds ngeom reals. These consist of:

So ngeom = 3 (lntp[9]) + lntp[10]) .

L3TPRN - rational B-curve in NURBs form:

geom holds ngeom reals. These consist of:

So ngeom = 4 (lntp[9]) + lntp[10]) .

L3TPFV - facet vertices:

geom holds ngeom vectors defining the vertices of a facet.

L3TPFN - facet vertices + surface normals:

geom holds:

L3TPFP - facet vertices + parameters

geom holds:

L3TPFI - facet vertices + normals + parameters

geom holds:

L3TPF1 - facet vertices + normals + parameters + 1st derivs

geom holds

L3TPF2 - facet vertices + normals + parameters + all derivs

geom holds

L3TPTS - facet strip vertices:

geom holds ngeom vectors defining the vertices of a facet strip.

L3TPTN - facet strip vertices plus surface normals:

geom holds:

L3TPTP - facet strip vertices plus parameters:

geom holds:

L3TPTI - facet strip vertices plus normals plus parameters:

geom holds:

L3TPT1 - facet strip vertices + normals + parameters + 1st derivs

geom holds:

L3TPT2 - facet strip vertices + normals + parameters + all derivs

geom holds:

If a facet has multiple loops the outer loop is output first and the inner loops follow. The vertices of the outer loop are ordered anticlockwise when viewed down the surface normal. The vertices of inner loops are ordered clockwise. Facets are manifold; i.e. no vertex coincides with any other in the same facet, nor does it lie in any edge in the same facet.

For facet strips the vertices of the first facet in the strip are held in elements 0, 1 and 2 of geom and are ordered anticlockwise when viewed down the surface normal. The vertices of the second facet are held in elements 1, 2 and 3 and are ordered clockwise. The vertices of the n-th facet are held in elements n-1, n and n+1 and are ordered anticlockwise if n is odd and clockwise if n is even. If lntp[1] is L3TPTS then the number of facets in a strip is given by ngeom -2. If lntp[1] is L3TPTN then the number of facets is given by ngeom /2 - 2.

For visibility segments (SGTPVT/SGTPVP) geom contains the visibility transition points (i.e. vectors in model space at which the edge changes visibility). Segments of type SGTPVP contain parameters as well. If the edge has only one visibility then no geometry is output.

The geometry array in an unparametrised (SGTPVT) visibility segment holds a sequence of sets of three doubles (x, y, z,) corresponding to the vector position of the transition points in model space.

The geometry array in a parametrised (SGTPVP) visibility segment holds a sequence of sets of four doubles (x, y, z, t) corresponding to the vector position of the transition points and their parameter on the geometry segment.

For error segments (SGTPER) ngeom is zero.

nlntp, lntp

An array of integers specifying the type of geometry of the segment and other codes as follows:

lntp[0] - Occurrence number of the entity from which the segment was derived.

If the segment type is SGTPER

lntp[1] - Reason why Parasolid is unable to render the entity:

 

ERNOGO

4001

unspecified error

ERRUBB

4002

Rubber entity (no geometry attached)

ERSANG

4003

Surface angular tolerance too small

ERSDIS

4004

Surface distance tolerance too small

ERCANG

4005

Curve angular tolerance too small

ERCDIS

4006

Curve distance tolerance too small

ERCLEN

4007

Chord chord length tolerance too small

ERFWID

4008

Facet width tolerance too small

If the segment type is SGTPVT or SGTPVP

See "Visibility Segment: SGTPVT" in Chapter 4, "Graphical Output", for more detail.

Otherwise

lntp[1] - Geometry type; one of the values:

 

L3TPSL

3001

Straight line

L3TPCI

3002

Partial circle

L3TPCC

3003

Complete circle

L3TPEL

3004

Partial ellipse

L3TPCE

3005

Complete ellipse

L3TPPY

3006

Poly-line

L3TPFV

3007

Facet vertices

L3TPFN

3008

Facet vertices plus surface normals

L3TPPC

3009

Non-rational B-curve

L3TPRC

3010

Rational B-curve

L3TPTS

3011

Facet strip vertices

L3TPTN

3012

Facet strip vertices + surface normals

L3TPNC

3013

Non-rational B-curve (NURBs form)

L3TPRN

3014

Rational B-curve (NURBs form)

L3TPFP

3015

Facet vertices + parameters

L3TPFI

3016

Facet vertices + normals + parameters

L3TPTP

3017

Facet strip vertices + parameters

L3TPTI

3018

Facet strip vertices + normals + parameters

L3TPF1

3019

Facet vertices + normals + parameters + 1st derivs

L3TPF2

3020

Facet vertices + normals + parameters + all derivs

L3TPT1

3021

Facet strip vertices + normals + parameters + 1st derivs

L3TPT2

3022

Facet strip vertices + normals + parameters + all derivs

If the geometry type is anything except L3TPFV, L3TPFN, L3TPTS or L3TPTN:

lntp[2] - Completeness; one of the values:

 

CODCOM

1001

Segment complete

CODINC

1002

Segment incomplete

CODUNC

1003

Segment may or may not be complete

lntp[3] - Visibility; one of the values:

 

CODVIS

1006

Line segment is visible

CODINV

1007

Line segment is invisible

CODUNV

1008

Visibility of line segment is unknown

CODDRV

1009

Line segment drafted visible

CODISH

1022

Line segment is invisible (hidden by own body occurrence)

lntp[4] - Smoothness; one of the values

 

CODSMO

1014

Edge is "smooth"

CODNSM

1015

Edge is not "smooth"

CODUNS

1016

Edge "smoothness" is unknown

CODSMS

1017

Edge "smooth" but coincident with silhouette

lntp[5] - Internal edge; one of the values

 

CODINE

1018

Edge is internal

CODNIN

1019

Edge is not internal

CODINU

1020

Not known whether edge is internal

CODINS

1021

Edge is internal, coincides with silhouette

CODIGN

1023

Edge lies on the boundary of an ignorable feature

If segtyp is SGTPGC, SGTPGS or SGTPGB then lntp[2..5] are always

 

lntp[2]

CODUNC

1003

Segment may or may not be complete

lntp[3]

CODUNV

1008

Visibility of segment is unknown

lntp[4]

CODUNS

1016

"smoothness" is unknown

lntp[5]

CODINU

1020

Not known whether internal

If regional data was requested in a call to hidden line drawing, lntp[6] and lntp[7] contain start and end point indices for SGTPED and SGTPSI segments. The indices uniquely identify the image points at each end of the segment.

If the geometry type is L3TPF*:

 

lntp[2]

number of loops in facet

lntp[3], lntp[4], ...

number of vertices in each loop

If the geometry type is L3TPT*:

 

lntp[2]

number of vertices on the facet strip

If the geometry type is L3TPPC or L3TPRC:

 

lntp[8]

degree of the parametric curve

If the geometry type is L3TPNC or L3TPRN:

 

lntp[8]

degree of the NURBs curve

lntp[9]

number of b-spline vertices

lntp[10]

number of knots

If segtyp is SGTPMF there is one loop consisting of three vertices.

If segtyp type is SGTPSI then the last element in the lntp array is the silhouette label.

ifail

A code indicating whether the Frustrum wants to abort graphic output; one of the values

 

CONTIN

0

Continue: no errors

ABORT

-1011

Abort: return control to caller

[back to top]


B.3 GOOPSG - open hierarchical segment

 

void GOOPSG
(
                      /* received arguments                */
const int    *segtyp, /* type (SGTPBY, SGTPFA ... )        */
const int    *ntags,  /* size of tag array                 */
const int    *tags,   /* tags associated with segment      */
const int    *ngeom,  /* size of geom array                */
const double *geom,   /* geometry of segment               */
const int    *nlntp,  /* size of line type array           */
const int    *lntp,   /* occ num, geom type, smoothness... */
                      /* returned arguments                */
int          *ifail   /* failure code: CONTIN or ABORT     */
)

The arguments have the following significance.

segtyp

The type of the segment; one of the following values:

 

SGTPBY

2003

body

SGTPED

2006

edge

SGTPSI

2007

silhouette

SGTPPH

2008

planar hatch-line

SGTPRH

2009

radial hatch-line

SGTPPL

2012

parametric hatch-line

SGTPFA

2017

face

SGTPGC

2019

geometry ... curve

SGTPGS

2020

geometry ... surface

ntags, tags

An array of tags associated with the segment. The tags given depend upon the segment type as follows:

 

SGTPBY

tag of body

SGTPED

tag of edge

SGTPSI SGTPPH SGTPRH SGTPPL

tag of face

SGTPFA

tag of face

SGTPGC

tag of curve

SGTPGS

tag of surface

ngeom, geom

An array of reals giving the geometry of the segment. The geometry given depends upon the segment type as follows:

 

SGTPBY

model space box of the body, given as two vectors: (xmin, ymin, zmin), (xmax, ymax, zmax)

SGTPED SGTPSI SGTPPH SGTPRH SGTPPL

no geometry returned

SGTPFA

model space box of the face

SGTPGC

model space box of the curve

SGTPGS

model space box of the surface

nlntp, lntp

An array of integers:

 

lntp[0]

occurrence number of the entity from which the segment was derived

lntp[1]

silhouette label if segtyp is SGTPSI

ifail

A code indicating whether the Frustrum wants to abort graphic output; one of the values:

 

CONTIN

0

Continue: no errors

ABORT

-1011

Abort: return control to caller

[back to top]


B.4 GOCLSG - close hierarchical segment

 

void GOCLSG
(
                      /* received arguments                */
const int    *segtyp, /* type (SGTPBY, SGTPFA ... )        */
const int    *ntags,  /* size of tag array                 */
const int    *tags,   /* tags associated with segment      */
const int    *ngeom,  /* size of geom array                */
const double *geom,   /* geometry of segment               */
const int    *nlntp,  /* size of line type array           */
const int    *lntp,   /* occ num, geom type, smoothness... */
                      /* returned arguments                */
int          *ifail   /* failure code: CONTIN or ABORT     */
)

The arguments have the following significance:

segtyp

The type of the segment; one of the following values:

 

SGTPBY

2003

body

SGTPED

2006

edge

SGTPSI

2007

silhouette

SGTPPH

2008

planar hatch-line

SGTPRH

2009

radial hatch-line

SGTPPL

2012

parametric hatch-line

SGTPFA

2017

face

SGTPGC

2019

geometry ... curve

SGTPGS

2020

geometry ... surface

ntags, tags

An array of tags associated with the segment. The tags given depend upon the segment type as follows:

 

SGTPBY

tag of body

SGTPED

tag of edge

SGTPSI SGTPPH SGTPRH SGTPPL

tag of face

SGTPFA

tag of face

SGTPGC

tag of the curve

SGTPGS

tag of the surface

ngeom, geom

An array of reals giving the geometry of the segment. The geometry given depends upon the segment type as follows:

 

SGTPBY

model space box of the body, given as two vectors: (xmin, ymin, zmin), (xmax, ymax, zmax)

SGTPED SGTPSI SGTPPH SGTPRH SGTPPL

no geometry returned

SGTPFA

model space box of the face

SGTPGC

model space box of the curve

SGTPGS

model space box of the surface

nlntp, lntp

An array of integers:

 

lntp[0]

Occurrence number of the entity from which the segment was derived

lntp[1]

silhouette label if segtyp is SGTPSI

ifail

A code indicating whether the Frustrum wants to abort graphic output; one of the values:

 

CONTIN

0

Continue: no errors

ABORT

-1011

Abort: return control to caller

[back to top]

<<< Frustrum Functions Chapters PK_DELTA Functions >>>