60 const float aaa = aTransparency * aTransparency * aTransparency;
63 float ca = 1.0f - aTransparency;
64 ca = 1.00f - 1.05f * ca * ca * ca;
66 return glm::max( glm::min( aGrayColorValue * ca + aaa, 1.0f ), 0.0f );
72#define UNITS3D_TO_UNITSPCB ( pcbIUScale.IU_PER_MM )
99 const SFVEC3F copperSpecularLinear =
105 SFVEC3F( 0.0f ), copperSpecularLinear, 0.4f * 128.0f, 0.0f, 0.0f );
112 SFVEC3F( 0.256f, 0.137f, 0.086f ), 0.15f * 128.0f, 0.0f, 0.0f );
124 0.10f * 128.0f, 0.0f, 0.0f );
130 SFVEC3F( 0.0f ),
SFVEC3F( 0.10f ) ), 0.078125f * 128.0f, 0.0f, 0.0f );
136 const float solderMask_gray =
147 SFVEC3F( glm::clamp( solderMask_gray * 2.0f, 0.25f, 1.0f ) ), 0.85f * 128.0f,
148 solderMask_transparency, 0.16f );
151 m_materials.m_SolderMask.SetRefractionRayCount( 1 );
172 (
SFVEC3F( 1.0f ) - bgTop ) / 3.0f,
173 0.10f * 128.0f, 1.0f, 0.50f );
175 m_materials.m_Floor.SetReflectionRecursionCount( 1 );
180 float aZMin,
float aZMax,
const MATERIAL* aMaterial,
185 case OBJECT_2D_TYPE::DUMMYBLOCK:
195 aDstContainer.
Add( objPtr );
202 aDstContainer.
Add( objPtr );
206 case OBJECT_2D_TYPE::ROUNDSEG:
214 aDstContainer.
Add( objPtr );
223 aDstContainer.
Add( objPtr );
234 float aLayerZOffset )
236 if( aContainer2d ==
nullptr )
243 if( listObject2d.size() == 0 )
246 for(
const OBJECT_2D* object2d_A : listObject2d )
254 object2d_B =
new std::vector<const OBJECT_2D*>();
264 if( layerHolesMap.find( aLayer_id ) != layerHolesMap.end() )
272 for(
const OBJECT_2D* hole2d : intersecting )
273 object2d_B->push_back( hole2d );
283 if( !throughHoleOuter.
GetList().empty() )
289 for(
const OBJECT_2D* hole2d : intersecting )
290 object2d_B->push_back( hole2d );
301 for(
const OBJECT_2D* obj : intersecting )
302 object2d_B->push_back( obj );
308 && ( ( aLayer_id ==
B_SilkS && mapLayers.find(
B_Mask ) != mapLayers.end() )
309 || ( aLayer_id ==
F_SilkS && mapLayers.find(
F_Mask ) != mapLayers.end() ) ) )
317 if( containerMaskLayer2d )
320 for(
const OBJECT_2D* obj2d : intersecting )
321 object2d_B->push_back( obj2d );
324 if( object2d_B->empty() )
362 bool aOnlyLoadCopperAndShapes )
373 if( !aOnlyLoadCopperAndShapes )
386 if( aStatusReporter )
387 aStatusReporter->
Report(
_(
"Load Raytracing: board" ) );
398 if( !aOnlyLoadCopperAndShapes )
402 if( outlineCount > 0 )
404 float divFactor = 0.0f;
421 for(
int ii = 0; ii < antiboardPoly.
OutlineCount(); ii++ )
432 for(
int ii = 0; ii < outlineCount; ii++ )
443 for(
const OBJECT_2D* object2d_A : listObjects )
445 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
455 for(
const OBJECT_2D* hole : intersecting )
457 if( object2d_A->Intersects( hole->GetBBox() ) )
458 object2d_B->push_back( hole );
469 for(
const OBJECT_2D* obj : intersecting )
470 object2d_B->push_back( obj );
473 if( object2d_B->empty() )
518 for(
const OBJECT_2D* hole2d : holeList )
528 if( !intersecting.empty() )
532 switch( hole2d->GetObjectType() )
534 case OBJECT_2D_TYPE::FILLED_CIRCLE:
536 const float radius = hole2d->GetBBox().GetExtent().x * 0.5f * 0.999f;
559 if( aStatusReporter )
560 aStatusReporter->
Report(
_(
"Load Raytracing: layers" ) );
631 layerColor =
SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f );
658 if( !aOnlyLoadCopperAndShapes )
703 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
713 for(
const OBJECT_2D* hole : intersecting )
715 if( object2d_A->Intersects( hole->GetBBox() ) )
716 object2d_B->push_back( hole );
722 if( !container2d->
GetList().empty() )
728 for(
const OBJECT_2D* obj : intersecting )
729 object2d_B->push_back( obj );
732 if( object2d_B->empty() )
742 materialLayer, layerColor );
756 object2d_A->GetBoardItem() );
773#ifdef PRINT_STATISTICS_3D_VIEWER
775 int64_t stats_startLoad3DmodelsTime = stats_endConvertTime;
778 if( aStatusReporter )
779 aStatusReporter->
Report(
_(
"Loading 3D models..." ) );
783#ifdef PRINT_STATISTICS_3D_VIEWER
787 if( !aOnlyLoadCopperAndShapes )
796 boardBBox.
Scale( 3.0f );
802 containerBBox.
Scale( 1.3f );
807 const float minZ = glm::min( containerBBox.
Min().z, boardBBox.
Min().z );
811 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
815 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
831 newTriangle1->
SetColor( floorColor );
832 newTriangle2->
SetColor( floorColor );
835 const float maxZ = glm::max( containerBBox.
Max().z, boardBBox.
Max().z );
851 newTriangle3->
SetColor( floorColor );
852 newTriangle4->
SetColor( floorColor );
866 return ( ( aSource.r < ( 1.0f / 255.0f ) ) && ( aSource.g < ( 1.0f / 255.0f ) )
867 && ( aSource.b < ( 1.0f / 255.0f ) ) );
880 if( !IsColorZero( cameraLightColor ) )
885 if( !IsColorZero( topLightColor ) )
892 if( !IsColorZero( bottomLightColor ) )
896 bottomLightColor ) );
904 if( !IsColorZero( lightColor ) )
927 if( min_zoom > max_zoom )
928 std::swap( min_zoom, max_zoom );
930 float zoom_ratio = max_zoom / min_zoom;
934 steps -=
static_cast<int>( ceil( log( zoom_ratio ) / log( 1.26f ) ) );
935 steps = std::max( steps, 0 );
938 float increased_zoom = pow( 1.26f, steps / 2 );
939 max_zoom *= increased_zoom;
940 min_zoom /= increased_zoom;
945 min_zoom = std::min( min_zoom, 1.0f );
955 if( aStatusReporter )
958 double calculation_time = (double) (
GetRunningMicroSecs() - stats_startReloadTime ) / 1e6;
960 aStatusReporter->
Report( wxString::Format(
_(
"Reload time %.3f s" ), calculation_time ) );
970 aVia->
LayerPair( &top_layer, &bottom_layer );
1002 const bool hasHole = drillsize.
x && drillsize.
y;
1015 if( drillsize.
x == drillsize.
y )
1020 int innerRadius = drillsize.
x / 2;
1035 antiOutlineIntersectionList );
1038 if( !antiOutlineIntersectionList.empty() )
1045 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1046 object2d_B->push_back( innerCircle );
1055 object2d_A = itemCSG2d;
1063 if( drillsize.
x > drillsize.
y )
1065 ends_offset.
x = ( drillsize.
x - drillsize.
y ) / 2;
1066 width = drillsize.
y;
1070 ends_offset.
y = ( drillsize.
y - drillsize.
x ) / 2;
1071 width = drillsize.
x;
1095 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1096 object2d_B->push_back( innerSeg );
1104 object2d_A = itemCSG2d;
1109 antiOutlineIntersectionList );
1115 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1125 for(
const OBJECT_2D* hole2d : intersecting )
1127 if( object2d_A->
Intersects( hole2d->GetBBox() ) )
1128 object2d_B->push_back( hole2d );
1132 for(
const OBJECT_2D* obj : antiOutlineIntersectionList )
1133 object2d_B->push_back( obj );
1135 if( object2d_B->empty() )
1187 for(
PAD*
pad : footprint->Pads() )
1189 if(
pad->GetAttribute() != PAD_ATTRIB::NPTH )
1212 if( !fp->Models().empty()
1219 glm::mat4 fpMatrix = glm::mat4( 1.0f );
1221 fpMatrix = glm::translate( fpMatrix,
1226 if( !fp->GetOrientation().IsZero() )
1228 fpMatrix = glm::rotate( fpMatrix, (
float) fp->GetOrientation().AsRadians(),
1229 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1232 if( fp->IsFlipped() )
1234 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1236 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1239 const double modelunit_to_3d_units_factor =
1242 fpMatrix = glm::scale(
1243 fpMatrix,
SFVEC3F( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor,
1244 modelunit_to_3d_units_factor ) );
1249 wxString libraryName = fp->GetFPID().GetLibNickname();
1251 wxString footprintBasePath = wxEmptyString;
1259 ->
FindRow( libraryName,
false );
1262 footprintBasePath = fpRow->
GetFullURI(
true );
1274 cacheMgr->
GetModel( model.m_Filename, footprintBasePath, fp );
1279 glm::mat4 modelMatrix = fpMatrix;
1281 modelMatrix = glm::translate( modelMatrix,
1282 SFVEC3F( model.m_Offset.x, model.m_Offset.y, model.m_Offset.z ) );
1284 modelMatrix = glm::rotate( modelMatrix,
1285 (
float) -( model.m_Rotation.z / 180.0f ) * glm::pi<float>(),
1286 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1288 modelMatrix = glm::rotate( modelMatrix,
1289 (
float) -( model.m_Rotation.y / 180.0f ) * glm::pi<float>(),
1290 SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1292 modelMatrix = glm::rotate( modelMatrix,
1293 (
float) -( model.m_Rotation.x / 180.0f ) * glm::pi<float>(),
1294 SFVEC3F( 1.0f, 0.0f, 0.0f ) );
1296 modelMatrix = glm::scale( modelMatrix,
1297 SFVEC3F( model.m_Scale.x, model.m_Scale.y, model.m_Scale.z ) );
1299 addModels( aDstContainer, modelPtr, modelMatrix, (
float) model.m_Opacity,
1300 aSkipMaterialInformation, fp );
1328 for(
unsigned int imat = 0; imat < a3DModel->
m_MaterialsSize; ++imat )
1336 float reflectionFactor = 0.0f;
1338 if( ( material.
m_Shininess - 0.35f ) > FLT_EPSILON )
1340 reflectionFactor = glm::clamp(
1341 glm::sqrt( ( material.
m_Shininess - 0.35f ) ) * 0.40f - 0.05f, 0.0f,
1407 return materialVector;
1412 const glm::mat4& aModelMatrix,
float aFPOpacity,
1413 bool aSkipMaterialInformation,
BOARD_ITEM* aBoardItem )
1416 wxASSERT( a3DModel !=
nullptr );
1418 if( a3DModel ==
nullptr )
1422 wxASSERT( a3DModel->
m_Meshes !=
nullptr );
1426 if( aFPOpacity > 1.0f )
1429 if( aFPOpacity < 0.0f )
1437 if( !aSkipMaterialInformation )
1442 const glm::mat3 normalMatrix = glm::transpose( glm::inverse( glm::mat3( aModelMatrix ) ) );
1444 for(
unsigned int mesh_i = 0; mesh_i < a3DModel->
m_MeshesSize; ++mesh_i )
1461 float fpTransparency;
1464 if( !aSkipMaterialInformation )
1473 for(
unsigned int faceIdx = 0; faceIdx < mesh.
m_FaceIdxSize; faceIdx += 3 )
1475 const unsigned int idx0 = mesh.
m_FaceIdx[faceIdx + 0];
1476 const unsigned int idx1 = mesh.
m_FaceIdx[faceIdx + 1];
1477 const unsigned int idx2 = mesh.
m_FaceIdx[faceIdx + 2];
1495 const SFVEC3F vt0 =
SFVEC3F( aModelMatrix * glm::vec4( v0, 1.0f ) );
1499 const SFVEC3F nt0 = glm::normalize(
SFVEC3F( normalMatrix * n0 ) );
1500 const SFVEC3F nt1 = glm::normalize(
SFVEC3F( normalMatrix * n1 ) );
1501 const SFVEC3F nt2 = glm::normalize(
SFVEC3F( normalMatrix * n2 ) );
1507 aDstContainer.
Add( newTriangle );
1509 if( !aSkipMaterialInformation )
Defines math related functions.
float NextFloatDown(float v)
float NextFloatUp(float v)
Defines math related functions.
float RGBtoGray(const SFVEC3F &aColor)
SFVEC3F MaterialDiffuseToColorCAD(const SFVEC3F &aDiffuseColor)
SFVEC3F SphericalToCartesian(float aInclination, float aAzimuth)
https://en.wikipedia.org/wiki/Spherical_coordinate_system
constexpr EDA_IU_SCALE pcbIUScale
std::map< PCB_LAYER_ID, BVH_CONTAINER_2D * > MAP_CONTAINER_2D_BASE
A type that stores a container of 2d objects for each layer id.
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
This BVH implementation is based on the source code implementation from the book "Physically Based Re...
Blinn Phong based material https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model.
double BiuTo3dUnits() const noexcept
Board integer units To 3D units.
SFVEC4F m_BgColorTop
background top color
const MAP_CONTAINER_2D_BASE & GetLayerHoleMap() const noexcept
SFVEC4F m_SolderPasteColor
in realistic mode: solder paste color
const SHAPE_POLY_SET & GetBoardPoly() const noexcept
Get the current polygon of the epoxy board.
bool IsFootprintShown(FOOTPRINT_ATTR_T aFPAttributes) const
Test if footprint should be displayed in relation to attributes and the flags.
const BBOX_3D & GetBBox() const noexcept
Get the board outling bounding box.
std::bitset< LAYER_3D_END > GetVisibleLayers() const
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
bool m_IsPreviewer
true if we're in a 3D preview panel, false for the standard 3D viewer
int GetHolePlatingThickness() const noexcept
Get the hole plating thickness (NB: in BOARD UNITS!).
void InitSettings(REPORTER *aStatusReporter, REPORTER *aWarningReporter)
Function to be called by the render when it need to reload the settings for the board.
const BVH_CONTAINER_2D & GetViaAnnuli() const noexcept
float GetLayerBottomZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the bottom z position.
const BVH_CONTAINER_2D & GetTH_IDs() const noexcept
SFVEC4F m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
SFVEC4F GetColor(const COLOR4D &aColor) const
const BVH_CONTAINER_2D * GetPlatedPadsBack() const noexcept
float GetBackCopperThickness() const noexcept
SFVEC4F m_CopperColor
in realistic mode: copper color
float GetAverageViaHoleDiameter() const noexcept
SFVEC2F GetSphericalCoord(int i) const
unsigned int GetViaCount() const noexcept
const BOARD * GetBoard() const noexcept
const SFVEC3F & GetBoardCenter() const noexcept
The board center position in 3D units.
float GetFootprintZPos(bool aIsFlipped) const
Get the position of the footprint in 3d integer units considering if it is flipped or not.
float GetLayerTopZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the top z position.
const BVH_CONTAINER_2D & GetTH_ODs() const noexcept
const MAP_CONTAINER_2D_BASE & GetLayerMap() const noexcept
Get the map of containers that have the objects per layer.
EDA_3D_VIEWER_SETTINGS * m_Cfg
SFVEC4F m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
unsigned int GetHoleCount() const noexcept
SFVEC4F m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
const BVH_CONTAINER_2D * GetPlatedPadsFront() const noexcept
float GetFrontCopperThickness() const noexcept
Get the copper layer thicknesses (in 3D units).
SFVEC4F m_BoardBodyColor
in realistic mode: FR4 board color
float GetAverageHoleDiameter() const noexcept
SFVEC4F m_UserCommentsColor
SFVEC4F m_UserDrawingsColor
S3D_CACHE * Get3dCacheManager() const noexcept
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
PROJECT * GetProject() const
void GetIntersectingObjects(const BBOX_2D &aBBox, CONST_LIST_OBJECT2D &aOutList) const override
Get a list of objects that intersects a bounding box.
void SetMinZoom(float minZoom)
void SetBoardLookAtPos(const SFVEC3F &aBoardPos)
static const float DEFAULT_MAX_ZOOM
void SetMaxZoom(float maxZoom)
const SFVEC3F & GetCameraInitPos() const
void Add(OBJECT_2D *aObject)
const LIST_OBJECT2D & GetList() const
const BBOX_3D & GetBBox() const
void Add(OBJECT_3D *aObject)
const LIST_OBJECT & GetList() const
Procedural generation of the copper normals.
void SetColor(SFVEC3F aObjColor)
A light source based only on a directional vector.
Hold a record identifying a library accessed by the appropriate footprint library #PLUGIN object in t...
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an FP_LIB_TABLE_ROW if aNickName is found in this table or in any chained fall back table frag...
Make solid geometry for objects on layers.
void SetColor(SFVEC3F aObjColor)
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
A base light class to derive to implement other light classes.
void SetCastShadows(bool aCastShadow)
Base material class that can be used to derive other material implementations.
static void SetDefaultReflectionRayCount(unsigned int aCount)
static void SetDefaultRefractionRayCount(unsigned int aCount)
static void SetDefaultRefractionRecursionCount(unsigned int aCount)
void SetGenerator(const MATERIAL_GENERATOR *aGenerator)
float GetTransparency() const
static void SetDefaultReflectionRecursionCount(unsigned int aCount)
static OBJECT_2D_STATS & Instance()
virtual bool Intersects(const BBOX_2D &aBBox) const =0
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
const BBOX_2D & GetBBox() const
const BOARD_ITEM & GetBoardItem() const
OBJECT_2D_TYPE GetObjectType() const
static OBJECT_3D_STATS & Instance()
void SetMaterial(const MATERIAL *aMaterial)
void SetModelTransparency(float aModelTransparency)
void SetBoardItem(BOARD_ITEM *aBoardItem)
const VECTOR2I & GetDrillSize() const
VECTOR2I GetPosition() const override
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
const VECTOR2I & GetStart() const
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
Procedural generation of the plastic normals.
Procedural generation of the shiny plastic normals.
Point light source based on http://ogldev.atspace.co.uk/www/tutorial20/tutorial20....
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
CAMERA & m_camera
Flag if the canvas specific for this render was already initialized.
bool m_reloadRequested
The window size that this camera is working.
BOARD_ADAPTER & m_boardAdapter
SILK_SCREEN_NORMAL m_silkScreenMaterial
void Reload(REPORTER *aStatusReporter, REPORTER *aWarningReporter, bool aOnlyLoadCopperAndShapes)
BOARD_NORMAL m_boardMaterial
CONTAINER_3D m_objectContainer
Store the list of created objects special for RT that will be clear in the end.
COPPER_NORMAL m_copperMaterial
void load3DModels(CONTAINER_3D &aDstContainer, bool aSkipMaterialInformation)
void insertHole(const PCB_VIA *aVia)
BRUSHED_METAL_NORMAL m_brushedMetalMaterial
static constexpr float MIN_DISTANCE_IU
PLATED_COPPER_NORMAL m_platedCopperMaterial
PLASTIC_NORMAL m_plasticMaterial
ACCELERATOR_3D * m_accelerator
void createItemsFromContainer(const BVH_CONTAINER_2D *aContainer2d, PCB_LAYER_ID aLayer_id, const MATERIAL *aMaterialLayer, const SFVEC3F &aLayerColor, float aLayerZOffset)
DIRECTIONAL_LIGHT * m_cameraLight
PLASTIC_SHINE_NORMAL m_shinyPlasticMaterial
unsigned int m_convertedDummyBlockCount
struct RENDER_3D_RAYTRACE_BASE::@5 m_materials
CONTAINER_2D * m_outlineBoard2dObjects
BVH_CONTAINER_2D * m_antioutlineBoard2dObjects
CONTAINER_2D m_containerWithObjectsToDelete
MODEL_MATERIALS * getModelMaterial(const S3DMODEL *a3DModel)
SOLDER_MASK_NORMAL m_solderMaskMaterial
void addModels(CONTAINER_3D &aDstContainer, const S3DMODEL *a3DModel, const glm::mat4 &aModelMatrix, float aFPOpacity, bool aSkipMaterialInformation, BOARD_ITEM *aBoardItem)
std::list< LIGHT * > m_lights
MAP_MODEL_MATERIALS m_modelMaterialMap
Stores materials of the 3D models.
void createObject(CONTAINER_3D &aDstContainer, const OBJECT_2D *aObject2D, float aZMin, float aZMax, const MATERIAL *aMaterial, const SFVEC3F &aObjColor)
Create one or more 3D objects form a 2D object and Z positions.
unsigned int m_converted2dRoundSegmentCount
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
void SetColor(SFVEC3F aObjColor)
Cache for storing the 3D shapes.
S3DMODEL * GetModel(const wxString &aModelFileName, const wxString &aBasePath, const EMBEDDED_FILES *aEmbeddedFiles)
Attempt to load the scene data for a model and to translate it into an S3D_MODEL structure for displa...
Represent a set of closed polygons.
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset difference For aFastMode meaning, see function booleanOp.
void Fracture(POLYGON_MODE aFastMode)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
int OutlineCount() const
Return the number of outlines in the set.
Procedural generation of the solder mask.
void SetColor(const SFVEC3F &aColor)
A plane that is parallel to XY plane.
void SetColor(SFVEC3F aObjColor)
std::list< OBJECT_2D * > LIST_OBJECT2D
std::list< const OBJECT_2D * > CONST_LIST_OBJECT2D
#define UNITS3D_TO_UNITSPCB
Implements a model viewer canvas.
Declaration of the eda_3d_viewer class.
@ LAYER_3D_SOLDERMASK_TOP
@ LAYER_3D_SOLDERMASK_BOTTOM
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
void ConvertPolygonToBlocks(const SHAPE_POLY_SET &aMainPath, CONTAINER_2D_BASE &aDstContainer, float aBiuTo3dUnitsScale, float aDivFactor, const BOARD_ITEM &aBoardItem, int aPolyIndex)
Use a polygon in the format of the ClipperLib::Path and process it and create multiple 2d objects (PO...
int64_t GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
void buildBoardBoundingBoxPoly(const BOARD *aBoard, SHAPE_POLY_SET &aOutline)
Get the complete bounding box of the board (including all items).
static float TransparencyControl(float aGrayColorValue, float aTransparency)
Perform an interpolation step to easy control the transparency based on the gray color value and tran...
SFVEC3F ConvertSRGBToLinear(const SFVEC3F &aSRGBcolor)
std::vector< BLINN_PHONG_MATERIAL > MODEL_MATERIALS
Vector of materials.
const SFVEC2F & Min() const
const SFVEC2F & Max() const
Manage a bounding box defined by two SFVEC3F min max points.
SFVEC3F GetCenter() const
Return the center point of the bounding box.
const SFVEC3F & Min() const
Return the minimum vertex pointer.
const SFVEC3F & Max() const
Return the maximum vertex pointer.
float GetMaxDimension() const
bool IsInitialized() const
Check if this bounding box is already initialized.
void Scale(float aScale)
Scales a bounding box by its center.
bool show_footprints_normal
MATERIAL_MODE material_mode
KIGFX::COLOR4D raytrace_lightColorCamera
std::vector< KIGFX::COLOR4D > raytrace_lightColor
KIGFX::COLOR4D raytrace_lightColorBottom
bool clip_silk_on_via_annuli
bool show_footprints_virtual
bool differentiate_plated_copper
int raytrace_nrsamples_reflections
bool subtract_mask_from_silk
int raytrace_recursivelevel_reflections
int raytrace_nrsamples_refractions
bool raytrace_procedural_textures
bool show_footprints_insert
int raytrace_recursivelevel_refractions
KIGFX::COLOR4D raytrace_lightColorTop
Store the a model based on meshes and materials.
SMATERIAL * m_Materials
The materials list of this model.
unsigned int m_MeshesSize
Number of meshes in the array.
SMESH * m_Meshes
The meshes list of this model.
unsigned int m_MaterialsSize
Number of materials in the material array.
float m_Transparency
1.0 is completely transparent, 0.0 completely opaque
SFVEC3F m_Diffuse
Default diffuse color if m_Color is NULL.
Per-vertex normal/color/texcoors structure.
unsigned int * m_FaceIdx
Triangle Face Indexes.
SFVEC3F * m_Normals
Vertex normals array.
unsigned int m_MaterialIdx
Material Index to be used in this mesh (must be < m_MaterialsSize )
unsigned int m_VertexSize
Number of vertex in the arrays.
unsigned int m_FaceIdxSize
Number of elements of the m_FaceIdx array.
SFVEC3F * m_Color
Vertex color array, can be NULL.
SFVEC3F * m_Positions
Vertex position array.
Implement a triangle ray intersection based on article http://www.flipcode.com/archives/Raytracing_To...
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
VECTOR2< int32_t > VECTOR2I