OakPDT Drawing
From Just Solve the File Format Problem
				
								
				(Difference between revisions)
				
																
				
				
								
				Ccawley2011  (Talk | contribs)  | 
			Ccawley2011  (Talk | contribs)   | 
			||
| Line 106: | Line 106: | ||
! colspan="3" | Dimension information  | ! colspan="3" | Dimension information  | ||
|-  | |-  | ||
| − | | 0 || Double ||  | + | | 0 || Double || The text width for dimensions.  | 
|-  | |-  | ||
| − | | 8 || Double ||  | + | | 8 || Double || The text width for dimensions.  | 
|-  | |-  | ||
| − | | 16 || Double ||  | + | | 16 || Double || The arrow head size.  | 
|-  | |-  | ||
| − | | 24 || Double ||  | + | | 24 || Double || Clearance gap  | 
|-  | |-  | ||
| − | | 32 || Integer ||  | + | | 32 || Integer || The current dimension style, which can be one of the following values:  | 
| + | * 0 for internal dimensions.  | ||
| + | * 1 for external left dimensions.  | ||
| + | * 2 for external right dimensions.  | ||
| + | * 3 for external dimensions.  | ||
|-  | |-  | ||
| − | | 36 || Integer ||  | + | | 36 || Integer || Use arrow heads for dimensions instead of slashes.  | 
|-  | |-  | ||
| − | | 40 || Integer ||  | + | | 40 || Integer || Are dimension tolerances enabled?  | 
|-  | |-  | ||
| − | | 44 || Integer ||  | + | | 44 || Integer || The dimension precision.  | 
|-  | |-  | ||
! colspan="3" | Line style information  | ! colspan="3" | Line style information  | ||
| Line 140: | Line 144: | ||
! colspan="3" | Error information  | ! colspan="3" | Error information  | ||
|-  | |-  | ||
| − | | 0 || Integer ||  | + | | 0 || Integer || A value associated with the last error. The exact purpose depends on the identifier.  | 
|-  | |-  | ||
| − | | 4 || Null-terminated string ||  | + | | 4 || Null-terminated string || The identifier of the last error to occur.  | 
|-  | |-  | ||
! colspan="3" | Layer information (v1.0 and v1.1)  | ! colspan="3" | Layer information (v1.0 and v1.1)  | ||
Revision as of 15:39, 19 October 2022
Overview
OakPDT is a 2D parametric CAD system for RISC OS. On RISC OS systems, files in this format typically have a filetype of CAD ("PDT Dwg").
Format details
| File Header | ||
|---|---|---|
| 0 | Byte | Major version number of the file format (always 1) | 
| 1 | Byte |  Minor version number of the format
  | 
| 2 | Null-terminated string |  The_Design_System or Oak_P_D_T_Drawing
 | 
| 20 | Integer |  Number of symbols (s)
 | 
| 24 | Array |  s symbol table entries
 | 
| Integer |  Size of drawing definition (v)
 | |
| Array |  v bytes
 | |
| Byte | Paper size | |
| Struct | Window definition | |
| Struct | Grid information | |
| Struct | Text information | |
| Struct | Dimension information | |
| Struct | Line style information | |
| Integer |  Number of scalars (n)
 | |
| Array |  n scalar table entries
 | |
| Struct | Error information | |
| Struct | Layer information | |
| Double | Dimension scale (only in v1.1 or later) | |
| Integer |  Number of functions (n) (only in v1.2 or later)
 | |
| Array |  n function table entries (only in v1.2 or later)
 | |
| Symbol table entry | ||
| 0 | Byte | Data type | 
| 1 | Byte |  Pen colour
  | 
| 2 | Byte |  Layer number
  | 
| 3 | Byte | Line type | 
| 4 | Integer | Address in drawing definition | 
| 8 | Integer | Length in drawing definition (ignored in later versions) | 
| Window definition | ||
| 0 | Double | Left X coordinate | 
| 8 | Double | Bottom Y coordinate | 
| 16 | Double | Right X coordinate | 
| 24 | Double | Top Y coordinate | 
| Grid information | ||
| 0 | Double | X spacing | 
| 8 | Double | Y spacing | 
| 16 | Double | X angle | 
| 24 | Double | Y angle | 
| 32 | Integer | Grid snap | 
| 36 | Integer | Parametric grid snap | 
| Text information | ||
| 0 | Double | Text width | 
| 8 | Double | Text height | 
| 16 | Double | Butterfly limit | 
| 24 | Integer | Text precision | 
| Dimension information | ||
| 0 | Double | The text width for dimensions. | 
| 8 | Double | The text width for dimensions. | 
| 16 | Double | The arrow head size. | 
| 24 | Double | Clearance gap | 
| 32 | Integer |  The current dimension style, which can be one of the following values:
  | 
| 36 | Integer | Use arrow heads for dimensions instead of slashes. | 
| 40 | Integer | Are dimension tolerances enabled? | 
| 44 | Integer | The dimension precision. | 
| Line style information | ||
| 0 | Integer | Definition of user-defined line style 1. | 
| 4 | Integer | Definition of user-defined line style 2. | 
| 8 | Integer | Definition of user-defined line style 3. | 
| 12 | Integer | Definition of user-defined line style 4. | 
| Scalar table entry | ||
| 0 | Integer | The symbol number of the scalar. | 
| 4 | Null-terminated string | The name of the scalar. | 
| Error information | ||
| 0 | Integer | A value associated with the last error. The exact purpose depends on the identifier. | 
| 4 | Null-terminated string | The identifier of the last error to occur. | 
| Layer information (v1.0 and v1.1) | ||
| 0 | Array |  16 bytes containing the status of each layer.
  | 
| 16 | Array | 16 bytes containing the default pen colour for each layer. | 
| 32 | Byte | The active current layer. | 
| 33 | Array | 10 bytes mapping each pen colour to a 16 colour palette entry. | 
| Layer information (v1.2) | ||
| 0 | Array |  64 bytes containing the status of each layer.
  | 
| 64 | Array | 64 bytes containing the default pen colour for each layer. | 
| 128 | Byte | The active current layer. | 
| 129 | Byte | The active points layer. | 
| 130 | Byte | The active construction layer. | 
| 131 | Array | 10 bytes mapping each pen colour to a 16 colour palette entry. | 
| Function table entry (v1.2 or later) | ||
| 0 | Null-terminated string | The name of the function. | 
| Integer | The number of parameters. | |
| Integer | The address of the function in the definition block. | |