Objects

objects/material

#include "dxfio/objects/material.hpp"

In DxfIO::Objects

struct Shade

One color of a material: its ambient, diffuse or specular color.

FieldType and defaultMeaning
Methodint0 to take the color of the object, 1 to override it with Color. Group 70, 71 or 76 by shade.
Factordouble{1}How much of the color shows, from 0 to 1. Group 40, 41 or 45 by shade.
Colorint{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.

FieldType and defaultMeaning
Blenddouble{1}How strongly the map shows, from 0 to 1. Group 42, 46, 48, 141, 143 or 146.
Sourceint{Bitmap}Where the map comes from: 0 the current scene, 1 an image file. Group 72, 77, 171, 175, 179 or 273.
Filestd::stringThe image file; empty for none. Group 3, 4, 6, 7, 8 or 9.
Projectionint{Box}How the map is projected: 1 planar, 2 box, 3 cylinder, 4 sphere. Group 73, 78, 172, 176, 270 or 274.
Tilingint{Tiled}How the map fills the surface: 1 tile, 2 crop, 3 clamp. Group 74, 79, 173, 177, 271 or 275.
Automaticint{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.
TransformDxfIO::MatrixThe 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.

FieldType and defaultMeaning
DiffuseMapThe map over the diffuse color.
SpecularMapThe map over the specular highlights.
ReflectionMapThe map of what the material reflects.
OpacityMapThe map of where the material is see-through.
BumpMapThe map that makes the surface look raised.
RefractionMap{ .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.

FieldType and defaultMeaning
BaseDxfIO::BaseThe handle, owner, reactors and extended data.
Namestd::stringThe name of the material, such as "Global". Group 1.
Descriptionstd::stringThe material's description. Group 2.
AmbientShadeThe color in ambient light. Groups 70, 40, 90.
DiffuseShadeThe color under direct light. Groups 71, 41, 91.
Glossdouble{Glossy}How glossy the surface is, from 0 to 1. Group 44.
SpecularShadeThe color of highlights. Groups 76, 45, 92.
Opacitydouble{1}How opaque the material is, from 0 to 1. Group 140.
Refractiondouble{1}The index of refraction. Group 145.
MapsBoxed<Objects::Maps>The maps laid over its channels, kept on the heap: six maps would make every object as large.
TranslucencedoubleHow much light passes through the material, from 0 to 1. Group 148, from R2007.
IlluminationdoubleHow much light the material gives off itself. Group 149, from R2007.
ReflectivitydoubleHow much light the material reflects. Group 468, from R2007.
ModelintThe illumination model it is shaded with. Group 93, from R2007.
Channelsstd::optional<int>Bits for the channels in use, one per map in the order of Maps; 63 for all six. Group 94, from R2007.
ModeintThe material's rendering mode. Group 282, from R2007.

Constants

Blackint = -1040187392Black as AutoCAD packs a color into one integer: a true color of 0, 0, 0.
Sceneint = 0A map source: the current scene.
Bitmapint = 1A map source: an image file.
Boxint = 2A map projection: onto the faces of a box.
Tiledint = 1A map tiling: the image repeats.
Manualint = 1A map's automatic transform: none.
Glossydouble = 0.5The gloss of a new material.