User:Le Forgeron/compound

From POV-Wiki
< User:Le Forgeron
Revision as of 11:10, 4 July 2018 by Le Forgeron (talk | contribs) (Created page with "{{User:Le_Forgeron/HgPovray38/soon}} == Access to part of compound object == Compound objects can be made of: * Constructive Solid Geometry (CSG : difference, union, merge, ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Access to part of compound object

Compound objects can be made of:

  • Constructive Solid Geometry (CSG : difference, union, merge, intersection)
  • Generalised Symetric Difference (GSD: interunion, intermerge)

Data access

The children function take an object as parameter, and return the number of first level sub-objects in it.

  • if parameter is not compound compatible, it returns -1

Getting a copy of an object inside a compound object

A small SDL extension, to retrieve the object inside an existing compound object (CSG or GSD).

child { CSG_Object_ID }( Index )

The index start at 0 for the first child of the CSG. Only the first level of the CSG is explored (recursion in CSG structure must be handled the same way: with recursion).

It is recommended to use children( CSG_Object_ID ) to check the object first, as child generates an error whenever:

  • the object is not compound
  • the index is out of bound in regard to the number of first level subobject in the compound object