56 const float aaa = aTransparency * aTransparency * aTransparency;
59 float ca = 1.0f - aTransparency;
60 ca = 1.00f - 1.05f * ca * ca * ca;
62 return glm::max( glm::min( aGrayColorValue * ca + aaa, 1.0f ), 0.0f );
68 #define UNITS3D_TO_UNITSPCB ( IU_PER_MM ) 102 const SFVEC3F copperSpecularLinear =
108 SFVEC3F( 0.0f ), copperSpecularLinear, 0.4f * 128.0f, 0.0f, 0.0f );
115 SFVEC3F( 0.256f, 0.137f, 0.086f ), 0.15f * 128.0f, 0.0f, 0.0f );
127 0.10f * 128.0f, 0.0f, 0.0f );
133 SFVEC3F( 0.0f ),
SFVEC3F( 0.10f ) ), 0.078125f * 128.0f, 0.0f, 0.0f );
139 const float solderMask_gray =
150 SFVEC3F( glm::clamp( solderMask_gray * 2.0f, 0.25f, 1.0f ) ), 0.85f * 128.0f,
151 solderMask_transparency, 0.16f );
154 m_materials.m_SolderMask.SetRefractionRayCount( 1 );
175 (
SFVEC3F( 1.0f ) - bgTop ) / 3.0f,
176 0.10f * 128.0f, 0.0f, 0.50f );
178 m_materials.m_Floor.SetReflectionRecursionCount( 1 );
183 float aZMin,
float aZMax,
const MATERIAL* aMaterial,
198 aDstContainer.
Add( objPtr );
205 aDstContainer.
Add( objPtr );
213 const ROUND_SEGMENT_2D* aRoundSeg2D = static_cast<const ROUND_SEGMENT_2D*>( aObject2D );
217 aDstContainer.
Add( objPtr );
226 aDstContainer.
Add( objPtr );
237 float aLayerZOffset )
239 if( aContainer2d ==
nullptr )
244 if( listObject2d.size() == 0 )
247 for(
const OBJECT_2D* object2d_A : listObject2d )
255 object2d_B =
new std::vector<const OBJECT_2D*>();
265 if( layerHolesMap.find( aLayer_id ) != layerHolesMap.end() )
273 for(
const OBJECT_2D* hole2d : intersecting )
274 object2d_B->push_back( hole2d );
287 if( !throughHoleOuter.
GetList().empty() )
293 for(
const OBJECT_2D* hole2d : intersecting )
294 object2d_B->push_back( hole2d );
305 for(
const OBJECT_2D* obj : intersecting )
306 object2d_B->push_back( obj );
313 && ( ( aLayer_id ==
B_SilkS && mapLayers.find(
B_Mask ) != mapLayers.end() )
314 || ( aLayer_id ==
F_SilkS && mapLayers.find(
F_Mask ) != mapLayers.end() ) ) )
318 const BVH_CONTAINER_2D* containerMaskLayer2d = mapLayers.at( layerMask_id );
322 if( containerMaskLayer2d )
325 for(
const OBJECT_2D* obj2d : intersecting )
326 object2d_B->push_back( obj2d );
329 if( object2d_B->empty() )
367 bool aOnlyLoadCopperAndShapes )
378 if( !aOnlyLoadCopperAndShapes )
391 if( aStatusReporter )
392 aStatusReporter->
Report(
_(
"Load Raytracing: board" ) );
401 if( !aOnlyLoadCopperAndShapes )
405 if( outlineCount > 0 )
407 float divFactor = 0.0f;
424 for(
int ii = 0; ii < antiboardPoly.
OutlineCount(); ii++ )
435 for(
int ii = 0; ii < outlineCount; ii++ )
446 for(
const OBJECT_2D* object2d_A : listObjects )
448 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
458 for(
const OBJECT_2D* hole : intersecting )
460 if( object2d_A->Intersects( hole->GetBBox() ) )
461 object2d_B->push_back( hole );
472 for(
const OBJECT_2D* obj : intersecting )
473 object2d_B->push_back( obj );
476 if( object2d_B->empty() )
521 for(
const OBJECT_2D* hole2d : holeList )
531 if( !intersecting.empty() )
535 switch( hole2d->GetObjectType() )
539 const float radius = hole2d->GetBBox().GetExtent().x * 0.5f * 0.999f;
562 if( aStatusReporter )
563 aStatusReporter->
Report(
_(
"Load Raytracing: layers" ) );
642 layerColor =
SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f );
671 if( !aOnlyLoadCopperAndShapes )
714 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
724 for(
const OBJECT_2D* hole : intersecting )
726 if( object2d_A->Intersects( hole->GetBBox() ) )
727 object2d_B->push_back( hole );
733 if( !container2d->
GetList().empty() )
739 for(
const OBJECT_2D* obj : intersecting )
740 object2d_B->push_back( obj );
743 if( object2d_B->empty() )
753 materialLayer, layerColor );
767 object2d_A->GetBoardItem() );
784 #ifdef PRINT_STATISTICS_3D_VIEWER 786 unsigned stats_startLoad3DmodelsTime = stats_endConvertTime;
789 if( aStatusReporter )
790 aStatusReporter->
Report(
_(
"Loading 3D models..." ) );
794 #ifdef PRINT_STATISTICS_3D_VIEWER 798 if( !aOnlyLoadCopperAndShapes )
807 boardBBox.
Scale( 3.0f );
813 containerBBox.
Scale( 1.3f );
818 const float minZ = glm::min( containerBBox.
Min().z, boardBBox.
Min().z );
822 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
826 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
842 newTriangle1->
SetColor( backgroundColor );
843 newTriangle2->
SetColor( backgroundColor );
846 const float maxZ = glm::max( containerBBox.
Max().z, boardBBox.
Max().z );
862 newTriangle3->
SetColor( backgroundColor );
863 newTriangle4->
SetColor( backgroundColor );
877 return ( ( aSource.r < ( 1.0f / 255.0f ) ) && ( aSource.g < ( 1.0f / 255.0f ) )
878 && ( aSource.b < ( 1.0f / 255.0f ) ) );
937 if( aStatusReporter )
952 aVia->
LayerPair( &top_layer, &bottom_layer );
998 const bool hasHole = drillsize.x && drillsize.y;
1011 if( drillsize.x == drillsize.y )
1016 int innerRadius = drillsize.x / 2;
1031 antiOutlineIntersectionList );
1034 if( !antiOutlineIntersectionList.empty() )
1041 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1042 object2d_B->push_back( innerCircle );
1051 object2d_A = itemCSG2d;
1056 wxPoint ends_offset;
1059 if( drillsize.x > drillsize.y )
1061 ends_offset.x = ( drillsize.x - drillsize.y ) / 2;
1062 width = drillsize.y;
1066 ends_offset.y = ( drillsize.y - drillsize.x ) / 2;
1067 width = drillsize.x;
1072 wxPoint start = aPad->
GetPosition() + ends_offset;
1091 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1092 object2d_B->push_back( innerSeg );
1100 object2d_A = itemCSG2d;
1105 antiOutlineIntersectionList );
1111 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1122 for(
const OBJECT_2D* hole2d : intersecting )
1124 if( object2d_A->
Intersects( hole2d->GetBBox() ) )
1125 object2d_B->push_back( hole2d );
1129 for(
const OBJECT_2D* obj : antiOutlineIntersectionList )
1130 object2d_B->push_back( obj );
1132 if( object2d_B->empty() )
1176 const PCB_VIA*
via = static_cast<const PCB_VIA*>( track );
1184 for(
PAD*
pad : footprint->Pads() )
1208 if( !fp->Models().empty()
1213 wxPoint pos = fp->GetPosition();
1215 glm::mat4 fpMatrix = glm::mat4( 1.0f );
1217 fpMatrix = glm::translate( fpMatrix,
1222 if( fp->GetOrientation() )
1224 fpMatrix = glm::rotate( fpMatrix,
1225 ( (
float) ( fp->GetOrientation() / 10.0f ) / 180.0f ) * glm::pi<float>(),
1226 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1229 if( fp->IsFlipped() )
1231 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1233 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1236 const double modelunit_to_3d_units_factor =
1240 fpMatrix,
SFVEC3F( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor,
1241 modelunit_to_3d_units_factor ) );
1243 BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( fp );
1247 auto sM = fp->Models().begin();
1248 auto eM = fp->Models().end();
1252 if( ( static_cast<float>( sM->m_Opacity ) > FLT_EPSILON )
1253 && ( sM->m_Show && !sM->m_Filename.empty() ) )
1261 glm::mat4 modelMatrix = fpMatrix;
1263 modelMatrix = glm::translate( modelMatrix,
1264 SFVEC3F( sM->m_Offset.x, sM->m_Offset.y, sM->m_Offset.z ) );
1266 modelMatrix = glm::rotate( modelMatrix,
1267 (
float) -( sM->m_Rotation.z / 180.0f ) * glm::pi<float>(),
1268 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1270 modelMatrix = glm::rotate( modelMatrix,
1271 (
float) -( sM->m_Rotation.y / 180.0f ) * glm::pi<float>(),
1272 SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1274 modelMatrix = glm::rotate( modelMatrix,
1275 (
float) -( sM->m_Rotation.x / 180.0f ) * glm::pi<float>(),
1276 SFVEC3F( 1.0f, 0.0f, 0.0f ) );
1279 SFVEC3F( sM->m_Scale.x, sM->m_Scale.y, sM->m_Scale.z ) );
1281 addModels( aDstContainer, modelPtr, modelMatrix, (
float) sM->m_Opacity,
1282 aSkipMaterialInformation, boardItem );
1313 for(
unsigned int imat = 0; imat < a3DModel->
m_MaterialsSize; ++imat )
1321 float reflectionFactor = 0.0f;
1323 if( ( material.
m_Shininess - 0.35f ) > FLT_EPSILON )
1325 reflectionFactor = glm::clamp(
1326 glm::sqrt( ( material.
m_Shininess - 0.35f ) ) * 0.40f - 0.05f, 0.0f,
1392 return materialVector;
1397 const glm::mat4& aModelMatrix,
float aFPOpacity,
1398 bool aSkipMaterialInformation,
BOARD_ITEM* aBoardItem )
1401 wxASSERT( a3DModel !=
nullptr );
1403 if( a3DModel ==
nullptr )
1407 wxASSERT( a3DModel->
m_Meshes !=
nullptr );
1410 wxASSERT( aFPOpacity > 0.0f );
1411 wxASSERT( aFPOpacity <= 1.0f );
1413 if( aFPOpacity > 1.0f )
1423 if( !aSkipMaterialInformation )
1428 const glm::mat3 normalMatrix = glm::transpose( glm::inverse( glm::mat3( aModelMatrix ) ) );
1430 for(
unsigned int mesh_i = 0; mesh_i < a3DModel->
m_MeshesSize; ++mesh_i )
1447 float fpTransparency;
1450 if( !aSkipMaterialInformation )
1459 for(
unsigned int faceIdx = 0; faceIdx < mesh.
m_FaceIdxSize; faceIdx += 3 )
1461 const unsigned int idx0 = mesh.
m_FaceIdx[faceIdx + 0];
1462 const unsigned int idx1 = mesh.
m_FaceIdx[faceIdx + 1];
1463 const unsigned int idx2 = mesh.
m_FaceIdx[faceIdx + 2];
1481 const SFVEC3F vt0 =
SFVEC3F( aModelMatrix * glm::vec4( v0, 1.0f ) );
1482 const SFVEC3F vt1 =
SFVEC3F( aModelMatrix * glm::vec4( v1, 1.0f ) );
1485 const SFVEC3F nt0 = glm::normalize(
SFVEC3F( normalMatrix * n0 ) );
1486 const SFVEC3F nt1 = glm::normalize(
SFVEC3F( normalMatrix * n1 ) );
1487 const SFVEC3F nt2 = glm::normalize(
SFVEC3F( normalMatrix * n2 ) );
1493 aDstContainer.
Add( newTriangle );
1495 if( !aSkipMaterialInformation )
Use a gray shading based on diffuse material.
void SetMinZoom(float minZoom)
Implement a triangle ray intersection based on article http://www.flipcode.com/archives/Raytracing_To...
SFVEC3F * m_Normals
Vertex normals array.
float GetTransparency() const
void SetColor(SFVEC3F aObjColor)
bool GetFlag(DISPLAY3D_FLG aFlag) const
Get a configuration status of a flag.
void SetBoardLookAtPos(const SFVEC3F &aBoardPos)
BOARD_ADAPTER & m_boardAdapter
std::list< const OBJECT_2D * > CONST_LIST_OBJECT2D
float RGBtoGray(const SFVEC3F &aColor)
VECTOR2I v2(1, 0)
Test suite for KiCad math code.
Procedural generation of the copper normals.
Defines math related functions.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
A base light class to derive to implement other light classes.
SFVEC4F m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
SOLDER_MASK_NORMAL m_solderMaskMaterial
MAP_MODEL_MATERIALS m_modelMaterialMap
Stores materials of the 3D models.
void SetColor(SFVEC3F aObjColor)
void SetModelTransparency(float aModelTransparency)
static void SetDefaultReflectionRecursionCount(unsigned int aCount)
const SFVEC3F & Max() const
Return the maximum vertex pointer.
bool IsFootprintShown(FOOTPRINT_ATTR_T aFPAttributes) const
Test if footprint should be displayed in relation to attributes and the flags.
static void SetDefaultRefractionRecursionCount(unsigned int aCount)
Implementation of conversion functions that require both schematic and board internal units.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
unsigned int m_convertedDummyBlockCount
MODEL_MATERIALS * getModelMaterial(const S3DMODEL *a3DModel)
COPPER_NORMAL m_copperMaterial
VIATYPE GetViaType() const
Manage a bounding box defined by two SFVEC3F min max points.
const SFVEC3F & GetCameraInitPos() const
static constexpr double IU_PER_MM
Mock up a conversion function.
const BVH_CONTAINER_2D & GetThroughHoleAnnularRings() const noexcept
Get the through hole annular rings container.
PLATED_COPPER_NORMAL m_platedCopperMaterial
SFVEC4F m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
const MAP_CONTAINER_2D_BASE & GetLayerMap() const noexcept
Get the map of containers that have the objects per layer.
float GetAverageHoleDiameter() const noexcept
Average diameter of through holes.
void SetGenerator(const MATERIAL_GENERATOR *aGenerator)
#define UNITS3D_TO_UNITSPCB
Scale conversion from 3d model units to pcb units.
void InitSettings(REPORTER *aStatusReporter, REPORTER *aWarningReporter)
Function to be called by the render when it need to reload the settings for the board.
std::vector< SFVEC2F > m_RtLightSphericalCoords
const LIST_OBJECT & GetList() const
SFVEC4F m_BoardBodyColor
in realistic mode: FR4 board color
SFVEC4F m_SolderPasteColor
in realistic mode: solder paste color
Procedural generation of the plastic normals.
std::vector< BLINN_PHONG_MATERIAL > MODEL_MATERIALS
Vector of materials.
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
float m_Transparency
1.0 is completely transparent, 0.0 completely opaque
static float TransparencyControl(float aGrayColorValue, float aTransparency)
Perform an interpolation step to easy control the transparency based on the gray color value and tran...
void RotatePoint(int *pX, int *pY, double angle)
This BVH implementation is based on the source code implementation from the book "Physically Based Re...
Cache for storing the 3D shapes.
Blinn Phong based material https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model.
A pure virtual class used to derive REPORTER objects from.
SFVEC3F * m_Positions
Vertex position array.
std::list< LIGHT * > m_lights
Point light source based on http://ogldev.atspace.co.uk/www/tutorial20/tutorial20....
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
Per-vertex normal/color/texcoors structure.
SFVEC3F m_RtCameraLightColor
SMESH * m_Meshes
The meshes list of this model.
const SFVEC3F & Min() const
Return the minimum vertex pointer.
CONTAINER_2D m_containerWithObjectsToDelete
const LIST_OBJECT2D & GetList() const
S3DMODEL * GetModel(const wxString &aModelFileName)
Attempt to load the scene data for a model and to translate it into an S3D_MODEL structure for displa...
const BVH_CONTAINER_2D & GetThroughHoleIds() const noexcept
Get the through hole inner diameter container.
Base material class that can be used to derive other material implementations.
void Add(OBJECT_2D *aObject)
unsigned int m_FaceIdxSize
Number of elements of the m_FaceIdx array.
const SFVEC2F & Max() const
void SetColor(const SFVEC3F &aColor)
static void SetDefaultReflectionRayCount(unsigned int aCount)
SFVEC3F GetCenter() const
Return the center point of the bounding box.
static constexpr float MIN_DISTANCE_IU
const wxSize & GetDrillSize() const
void addModels(CONTAINER_3D &aDstContainer, const S3DMODEL *a3DModel, const glm::mat4 &aModelMatrix, float aFPOpacity, bool aSkipMaterialInformation, BOARD_ITEM *aBoardItem)
like PAD_PTH, but not plated
void Scale(float aScale)
Scales a bounding box by its center.
unsigned int m_VertexSize
Number of vertex in the arrays.
unsigned int m_converted2dRoundSegmentCount
const BVH_CONTAINER_2D * GetPlatedPadsBack() const noexcept
int m_RtRecursiveReflectionCount
SFVEC4F m_BgColorTop
background top color
double GetOrientation() const
Return the rotation angle of the pad in a variety of units (the basic call returns tenths of degrees)...
void SetMaterial(const MATERIAL *aMaterial)
Meta control for all vias opacity/visibility.
float NextFloatDown(float v)
S3D_CACHE * Get3dCacheManager() const noexcept
Return the 3D cache manager pointer.
Represent a set of closed polygons.
float GetLayerTopZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the top z position.
Use all material properties from model file.
const BBOX_2D & GetBBox() const
const void SetBoardItem(BOARD_ITEM *aBoardItem)
float GetMaxDimension() const
FOOTPRINTS & Footprints()
float GetLayerBottomZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the bottom z position.
MATERIAL_MODE GetMaterialMode() const noexcept
SFVEC3F m_RtLightColorTop
void load3DModels(CONTAINER_3D &aDstContainer, bool aSkipMaterialInformation)
static OBJECT_2D_STATS & Instance()
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...
SFVEC3F * m_Color
Vertex color array, can be NULL.
double BiuTo3dUnits() const noexcept
Board integer units To 3D units.
static OBJECT_3D_STATS & Instance()
const BOARD_ITEM & GetBoardItem() const
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Function LayerPair Return the 2 layers used by the via (the via actually uses all layers between thes...
void Reload(REPORTER *aStatusReporter, REPORTER *aWarningReporter, bool aOnlyLoadCopperAndShapes)
const BOARD * GetBoard() const noexcept
Get current board to be rendered.
const BVH_CONTAINER_2D & GetThroughHoleOds() const noexcept
Get the inflated through hole outside diameters container.
int m_RtRecursiveRefractionCount
std::vector< SFVEC3F > m_RtLightColor
OBJECT_2D_TYPE GetObjectType() const
const SHAPE_POLY_SET & GetBoardPoly() const noexcept
Get the current polygon of the epoxy board.
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.
unsigned int m_MaterialsSize
Number of materials in the material array.
bool IsInitialized() const
Check if this bounding box is already initialized.
int m_RtRefractionSampleCount
SFVEC4F GetItemColor(int aItemId) const
Get the technical color of a layer.
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.
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void GetIntersectingObjects(const BBOX_2D &aBBox, CONST_LIST_OBJECT2D &aOutList) const override
Get a list of objects that intersects a bounding box.
BRUSHED_METAL_NORMAL m_brushedMetalMaterial
void SetCastShadows(bool aCastShadow)
void buildBoardBoundingBoxPoly(const BOARD *aBoard, SHAPE_POLY_SET &aOutline)
Get the complete bounding box of the board (including all items).
PLASTIC_SHINE_NORMAL m_shinyPlasticMaterial
float GetFootprintZPos(bool aIsFlipped) const
Get the position of the footprint in 3d integer units considering if it is flipped or not.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
bool m_reloadRequested
The window size that this camera is working.
const BBOX_3D & GetBBox() const noexcept
Get the board outling bounding box.
unsigned int GetViaCount() const noexcept
Get number of vias in this board.
DIRECTIONAL_LIGHT * m_cameraLight
const SFVEC2F & Min() const
const BBOX_3D & GetBBox() const
A light source based only on a directional vector.
unsigned int GetHoleCount() const noexcept
Get number of holes in this board.
SFVEC4F GetLayerColor(PCB_LAYER_ID aLayerId) const
Get the technical color of a layer.
multilayer pads, usually with holes
const BVH_CONTAINER_2D * GetPlatedPadsFront() const noexcept
to draw blind/buried vias
Make solid geometry for objects on layers.
wxPoint GetPosition() const override
SFVEC3F MaterialDiffuseToColorCAD(const SFVEC3F &aDiffuseColor)
Information pertinent to a Pcbnew printed circuit board.
BOARD_NORMAL m_boardMaterial
unsigned GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
PCB_LAYER_ID
A quick note on layer IDs:
void SetColor(SFVEC3F aObjColor)
unsigned int m_MaterialIdx
Material Index to be used in this mesh (must be < m_MaterialsSize )
void createItemsFromContainer(const BVH_CONTAINER_2D *aContainer2d, PCB_LAYER_ID aLayer_id, const MATERIAL *aMaterialLayer, const SFVEC3F &aLayerColor, float aLayerZOffset)
SFVEC4F m_CopperColor
in realistic mode: copper color
void insertHole(const PCB_VIA *aVia)
float NextFloatUp(float v)
SMATERIAL * m_Materials
The materials list of this model.
const SFVEC3F & GetBoardCenter() const noexcept
The board center position in 3D units.
Procedural generation of the shiny plastic normals.
SFVEC3F SphericalToCartesian(float aInclination, float aAzimuth)
https://en.wikipedia.org/wiki/Spherical_coordinate_system
float GetAverageViaHoleDiameter() const noexcept
Thee average diameter of the via holes.
void SetColor(SFVEC3F aObjColor)
CAMERA & m_camera
Flag if the opengl specific for this render was already initialized.
Defines math related functions.
SFVEC3F m_Diffuse
Default diffuse color if m_Color is NULL.
void SetMaxZoom(float maxZoom)
std::list< OBJECT_2D * > LIST_OBJECT2D
SFVEC4F m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
float GetCopperThickness() const noexcept
Get the current copper layer thickness.
A plane that is parallel to XY plane.
class PCB_VIA, a via (like a track segment on a copper layer)
void Add(OBJECT_3D *aObject)
Store the a model based on meshes and materials.
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset intersection For aFastMode meaning, see function booleanOp.
static void SetDefaultRefractionRayCount(unsigned int aCount)
unsigned int * m_FaceIdx
Triangle Face Indexes.
Procedural generation of the solder mask.
SFVEC3F m_RtLightColorBottom
const MAP_CONTAINER_2D_BASE & GetLayerHoleMap() const noexcept
Get the map of container that have the holes per layer.
virtual bool Intersects(const BBOX_2D &aBBox) const =0
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
PLASTIC_NORMAL m_plasticMaterial
unsigned int m_MeshesSize
Number of meshes in the array.
ACCELERATOR_3D * m_accelerator
SFVEC3F ConvertSRGBToLinear(const SFVEC3F &aSRGBcolor)
CONTAINER_2D * m_outlineBoard2dObjects
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
int m_RtReflectionSampleCount
struct RENDER_3D_RAYTRACE::@5 m_materials
BVH_CONTAINER_2D * m_antioutlineBoard2dObjects
const wxPoint & GetStart() const
CONTAINER_3D m_objectContainer
Store the list of created objects special for RT that will be clear in the end.
int GetHolePlatingThickness() const noexcept
Get the current copper layer thickness.
SILK_SCREEN_NORMAL m_silkScreenMaterial