Objects
objects/ material
#include "dxfio/objects/material.hpp"In DxfIO::Objects
struct Shade
One color of a material: its ambient, diffuse or specular color.
| Field | Type and default | Meaning |
|---|---|---|
Method | int | 0 to take the color of the object, 1 to override it with Color. Group 70, 71 or 76 by shade. |
Factor | double{1} | How much of the color shows, from 0 to 1. Group 40, 41 or 45 by shade. |
Color | int{Black} | The color, packed into one integer as AutoCAD does. Group 90, 91 or 92 by shade. |
struct Map
One map of a material: the image laid over a channel and how it is projected. Its groups depend on the map; each member gives them in the order diffuse, specular, reflection, opacity, bump, refraction.
| Field | Type and default | Meaning |
|---|---|---|
Blend | double{1} | How strongly the map shows, from 0 to 1. Group 42, 46, 48, 141, 143 or 146. |
Source | int{Bitmap} | Where the map comes from: 0 the current scene, 1 an image file. Group 72, 77, 171, 175, 179 or 273. |
File | std::string | The image file; empty for none. Group 3, 4, 6, 7, 8 or 9. |
Projection | int{Box} | How the map is projected: 1 planar, 2 box, 3 cylinder, 4 sphere. Group 73, 78, 172, 176, 270 or 274. |
Tiling | int{Tiled} | How the map fills the surface: 1 tile, 2 crop, 3 clamp. Group 74, 79, 173, 177, 271 or 275. |
Automatic | int{Manual} | Bits: 1 for no automatic transform, 2 to fit the map to the object's extents, 4 to add the block's transform. Group 75, 170, 174, 178, 272 or 276. |
Transform | DxfIO::Matrix | The transform of the map's projection, 16 values row by row. Group 43, 47, 49, 142, 144 or 147. |
struct Maps
The maps of a material, one per channel.
| Field | Type and default | Meaning |
|---|---|---|
Diffuse | Map | The map over the diffuse color. |
Specular | Map | The map over the specular highlights. |
Reflection | Map | The map of what the material reflects. |
Opacity | Map | The map of where the material is see-through. |
Bump | Map | The map that makes the surface look raised. |
Refraction | Map{ .Blend = 1, .Source = Scene, .File = {}, .Projection = Box, .Tiling = Tiled, .Automatic = Manual, .Transform = Identity, } | The map of how light bends through the material; it takes the current scene unless told. |
struct MaterialMATERIAL
A MATERIAL: how the surfaces of the objects it is given to are rendered.
| Field | Type and default | Meaning |
|---|---|---|
Base | DxfIO::Base | The handle, owner, reactors and extended data. |
Name | std::string | The name of the material, such as "Global". Group 1. |
Description | std::string | The material's description. Group 2. |
Ambient | Shade | The color in ambient light. Groups 70, 40, 90. |
Diffuse | Shade | The color under direct light. Groups 71, 41, 91. |
Gloss | double{Glossy} | How glossy the surface is, from 0 to 1. Group 44. |
Specular | Shade | The color of highlights. Groups 76, 45, 92. |
Opacity | double{1} | How opaque the material is, from 0 to 1. Group 140. |
Refraction | double{1} | The index of refraction. Group 145. |
Maps | Boxed<Objects::Maps> | The maps laid over its channels, kept on the heap: six maps would make every object as large. |
Translucence | double | How much light passes through the material, from 0 to 1. Group 148, from R2007. |
Illumination | double | How much light the material gives off itself. Group 149, from R2007. |
Reflectivity | double | How much light the material reflects. Group 468, from R2007. |
Model | int | The illumination model it is shaded with. Group 93, from R2007. |
Channels | std::optional<int> | Bits for the channels in use, one per map in the order of Maps; 63 for all six. Group 94, from R2007. |
Mode | int | The material's rendering mode. Group 282, from R2007. |
Constants
Black | int = -1040187392 | Black as AutoCAD packs a color into one integer: a true color of 0, 0, 0. |
Scene | int = 0 | A map source: the current scene. |
Bitmap | int = 1 | A map source: an image file. |
Box | int = 2 | A map projection: onto the faces of a box. |
Tiled | int = 1 | A map tiling: the image repeats. |
Manual | int = 1 | A map's automatic transform: none. |
Glossy | double = 0.5 | The gloss of a new material. |