Expand description
CATIA V5 products (.CATProduct): which documents are placed where (see
docs/src/research/catia-product-structure.md).
-
Every CATIA document lists its containers near the start of the file:
02 00 81 20 | u32 n | name \0 | type \0 | up to 8 × 00 | 03 00 f7 00 03 00 00 00 | uuid (4 × u32 big-endian)Products refer to a component by the UUID of its container named
CATProdCont– no file name is stored (document). -
The product’s own
CATProdContis an object stream (OSMX) of sections7c <kind> <u32 length from the 7c>: header0c, objects04, one side block per object08, extensions0b, strings02. Small numbers are81..cf(− 0x81),d1..e3 xxor80 <u32>; a string reference is34..ff(− 0x34) or32 <u32 index + 1>; doubles aree6 <f64>,e7/e8/e9(1, 0, −1). -
An object (
7c 05) has a header7c 06(two flag bytes, class, name,ea <u32 id>) and attributes7c 07:<name> <key> e8|e9 <flags> <type> [byte after e9] 37 <value> fe(type12: a string,07:<n> <0> n doubles). -
An instance is an
ASMPRODUCTwith_InstanceName; its name is the part number. Its side block holds the link to the referenced document (e5 <u32 length> 11 03 <uuid> …) and the list_BagRepsList, whosePRDBAGREPcarries_Position: X, Y and Z axis and origin (mm) of the instance in the product. Without it the instance sits at the origin.
Everything is read defensively: every length is checked against the bytes that are left, and an instance that does not add up is left out, never a panic. No CATIA code or documentation was used.
Constants§
- HEAD
- The container table lies in the first bytes of the file.
- MAX_
PRODUCT - Largest product read.
Functions§
- components
- The instances of a product (the whole file): name = part number,
document= UUID of the referenced document.Nonewhen it is no CATIA product. - containers
- The containers of a CATIA document: (name, type, UUID).
- document
- The UUID products refer to this document by (its container named
CATProdCont), from the firstHEADbytes of a CATIA file. - document_
of documentof a file (reads only its first bytes).- kind_of
- What a product file holds: its instances, or
Kind::Other. - uuid_
text - The text form of a container UUID, as CATIA names its containers
(
Cont_<uuid>):hhhhhhhh_h_hhhhhhhh_h.
Type Aliases§
- Sample
Instance - An instance of [
sample]: part number, UUID of the referenced document, placement (X, Y, Z axis and origin) orNone.