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 )
103 const SFVEC3F copperSpecularLinear =
109 SFVEC3F( 0.0f ), copperSpecularLinear, 0.4f * 128.0f, 0.0f, 0.0f );
116 SFVEC3F( 0.256f, 0.137f, 0.086f ), 0.15f * 128.0f, 0.0f, 0.0f );
128 0.10f * 128.0f, 0.0f, 0.0f );
134 SFVEC3F( 0.0f ),
SFVEC3F( 0.10f ) ), 0.078125f * 128.0f, 0.0f, 0.0f );
140 const float solderMask_gray =
151 SFVEC3F( glm::clamp( solderMask_gray * 2.0f, 0.25f, 1.0f ) ), 0.85f * 128.0f,
152 solderMask_transparency, 0.16f );
155 m_materials.m_SolderMask.SetRefractionRayCount( 1 );
176 (
SFVEC3F( 1.0f ) - bgTop ) / 3.0f,
177 0.10f * 128.0f, 1.0f, 0.50f );
179 m_materials.m_Floor.SetReflectionRecursionCount( 1 );
184 float aZMin,
float aZMax,
const MATERIAL* aMaterial,
189 case OBJECT_2D_TYPE::DUMMYBLOCK:
199 aDstContainer.
Add( objPtr );
206 aDstContainer.
Add( objPtr );
210 case OBJECT_2D_TYPE::ROUNDSEG:
218 aDstContainer.
Add( objPtr );
227 aDstContainer.
Add( objPtr );
238 float aLayerZOffset )
240 if( aContainer2d ==
nullptr )
247 if( listObject2d.size() == 0 )
250 for(
const OBJECT_2D* object2d_A : listObject2d )
258 object2d_B =
new std::vector<const OBJECT_2D*>();
268 if( layerHolesMap.find( aLayer_id ) != layerHolesMap.end() )
276 for(
const OBJECT_2D* hole2d : intersecting )
277 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 );
312 && ( ( aLayer_id ==
B_SilkS && mapLayers.find(
B_Mask ) != mapLayers.end() )
313 || ( aLayer_id ==
F_SilkS && mapLayers.find(
F_Mask ) != mapLayers.end() ) ) )
321 if( containerMaskLayer2d )
324 for(
const OBJECT_2D* obj2d : intersecting )
325 object2d_B->push_back( obj2d );
328 if( object2d_B->empty() )
366 bool aOnlyLoadCopperAndShapes )
377 if( !aOnlyLoadCopperAndShapes )
390 if( aStatusReporter )
391 aStatusReporter->
Report(
_(
"Load Raytracing: board" ) );
402 if( !aOnlyLoadCopperAndShapes )
406 if( outlineCount > 0 )
408 float divFactor = 0.0f;
425 for(
int ii = 0; ii < antiboardPoly.
OutlineCount(); ii++ )
436 for(
int ii = 0; ii < boardPolyCopy.
OutlineCount(); ii++ )
447 for(
const OBJECT_2D* object2d_A : listObjects )
449 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
459 for(
const OBJECT_2D* hole : intersecting )
461 if( object2d_A->Intersects( hole->GetBBox() ) )
462 object2d_B->push_back( hole );
473 for(
const OBJECT_2D* obj : intersecting )
474 object2d_B->push_back( obj );
477 if( object2d_B->empty() )
522 for(
const OBJECT_2D* hole2d : holeList )
532 if( !intersecting.empty() )
536 switch( hole2d->GetObjectType() )
538 case OBJECT_2D_TYPE::FILLED_CIRCLE:
540 const float radius = hole2d->GetBBox().GetExtent().x * 0.5f * 0.999f;
564 if( aStatusReporter )
565 aStatusReporter->
Report(
_(
"Load Raytracing: layers" ) );
568 for(
const std::pair<const PCB_LAYER_ID, BVH_CONTAINER_2D*>& entry :
637 layerColor =
SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f );
664 if( !aOnlyLoadCopperAndShapes )
676 for(
const std::pair<const PCB_LAYER_ID, BVH_CONTAINER_2D*>& entry :
710 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
720 for(
const OBJECT_2D* hole : intersecting )
722 if( object2d_A->Intersects( hole->GetBBox() ) )
723 object2d_B->push_back( hole );
729 if( !container2d->
GetList().empty() )
735 for(
const OBJECT_2D* obj : intersecting )
736 object2d_B->push_back( obj );
739 if( object2d_B->empty() )
749 materialLayer, layerColor );
763 object2d_A->GetBoardItem() );
780#ifdef PRINT_STATISTICS_3D_VIEWER
782 int64_t stats_startLoad3DmodelsTime = stats_endConvertTime;
785 if( aStatusReporter )
786 aStatusReporter->
Report(
_(
"Loading 3D models..." ) );
790#ifdef PRINT_STATISTICS_3D_VIEWER
794 if( !aOnlyLoadCopperAndShapes )
803 boardBBox.
Scale( 3.0f );
809 containerBBox.
Scale( 1.3f );
814 const float minZ = glm::min( containerBBox.
Min().z, boardBBox.
Min().z );
818 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
822 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
838 newTriangle1->
SetColor( floorColor );
839 newTriangle2->
SetColor( floorColor );
842 const float maxZ = glm::max( containerBBox.
Max().z, boardBBox.
Max().z );
858 newTriangle3->
SetColor( floorColor );
859 newTriangle4->
SetColor( floorColor );
873 return ( ( aSource.r < ( 1.0f / 255.0f ) ) && ( aSource.g < ( 1.0f / 255.0f ) )
874 && ( aSource.b < ( 1.0f / 255.0f ) ) );
887 if( !IsColorZero( cameraLightColor ) )
892 if( !IsColorZero( topLightColor ) )
899 if( !IsColorZero( bottomLightColor ) )
903 bottomLightColor ) );
911 if( !IsColorZero( lightColor ) )
934 if( min_zoom > max_zoom )
935 std::swap( min_zoom, max_zoom );
937 float zoom_ratio = max_zoom / min_zoom;
941 steps -=
static_cast<int>( ceil( log( zoom_ratio ) / log( 1.26f ) ) );
942 steps = std::max( steps, 0 );
945 float increased_zoom = pow( 1.26f, steps / 2 );
946 max_zoom *= increased_zoom;
947 min_zoom /= increased_zoom;
952 min_zoom = std::min( min_zoom, 1.0f );
962 if( aStatusReporter )
965 double calculation_time = (double) (
GetRunningMicroSecs() - stats_startReloadTime ) / 1e6;
967 aStatusReporter->
Report( wxString::Format(
_(
"Reload time %.3f s" ), calculation_time ) );
977 aVia->
LayerPair( &top_layer, &bottom_layer );
1009 const bool hasHole = drillsize.
x && drillsize.
y;
1022 if( drillsize.
x == drillsize.
y )
1027 int innerRadius = drillsize.
x / 2;
1042 antiOutlineIntersectionList );
1045 if( !antiOutlineIntersectionList.empty() )
1052 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1053 object2d_B->push_back( innerCircle );
1062 object2d_A = itemCSG2d;
1070 if( drillsize.
x > drillsize.
y )
1072 ends_offset.
x = ( drillsize.
x - drillsize.
y ) / 2;
1073 width = drillsize.
y;
1077 ends_offset.
y = ( drillsize.
y - drillsize.
x ) / 2;
1078 width = drillsize.
x;
1102 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1103 object2d_B->push_back( innerSeg );
1111 object2d_A = itemCSG2d;
1116 antiOutlineIntersectionList );
1122 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1132 for(
const OBJECT_2D* hole2d : intersecting )
1134 if( object2d_A->
Intersects( hole2d->GetBBox() ) )
1135 object2d_B->push_back( hole2d );
1139 for(
const OBJECT_2D* obj : antiOutlineIntersectionList )
1140 object2d_B->push_back( obj );
1142 if( object2d_B->empty() )
1194 for(
PAD*
pad : footprint->Pads() )
1196 if(
pad->GetAttribute() != PAD_ATTRIB::NPTH )
1204 bool aSkipMaterialInformation )
1220 if( !fp->Models().empty()
1227 glm::mat4 fpMatrix = glm::mat4( 1.0f );
1229 fpMatrix = glm::translate( fpMatrix,
1234 if( !fp->GetOrientation().IsZero() )
1236 fpMatrix = glm::rotate( fpMatrix, (
float) fp->GetOrientation().AsRadians(),
1237 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1240 if( fp->IsFlipped() )
1242 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1244 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1247 const double modelunit_to_3d_units_factor =
1250 fpMatrix = glm::scale(
1251 fpMatrix,
SFVEC3F( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor,
1252 modelunit_to_3d_units_factor ) );
1257 wxString libraryName = fp->GetFPID().GetLibNickname();
1259 wxString footprintBasePath = wxEmptyString;
1268 ->
FindRow( libraryName,
false );
1271 footprintBasePath = fpRow->
GetFullURI(
true );
1283 cacheMgr->
GetModel( model.m_Filename, footprintBasePath, fp );
1288 glm::mat4 modelMatrix = fpMatrix;
1290 modelMatrix = glm::translate( modelMatrix,
1291 SFVEC3F( model.m_Offset.x, model.m_Offset.y, model.m_Offset.z ) );
1293 modelMatrix = glm::rotate( modelMatrix,
1294 (
float) -( model.m_Rotation.z / 180.0f ) * glm::pi<float>(),
1295 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1297 modelMatrix = glm::rotate( modelMatrix,
1298 (
float) -( model.m_Rotation.y / 180.0f ) * glm::pi<float>(),
1299 SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1301 modelMatrix = glm::rotate( modelMatrix,
1302 (
float) -( model.m_Rotation.x / 180.0f ) * glm::pi<float>(),
1303 SFVEC3F( 1.0f, 0.0f, 0.0f ) );
1305 modelMatrix = glm::scale( modelMatrix,
1306 SFVEC3F( model.m_Scale.x, model.m_Scale.y, model.m_Scale.z ) );
1308 addModels( aDstContainer, modelPtr, modelMatrix, (
float) model.m_Opacity,
1309 aSkipMaterialInformation, fp );
1337 for(
unsigned int imat = 0; imat < a3DModel->
m_MaterialsSize; ++imat )
1345 float reflectionFactor = 0.0f;
1347 if( ( material.
m_Shininess - 0.35f ) > FLT_EPSILON )
1349 reflectionFactor = glm::clamp(
1350 glm::sqrt( ( material.
m_Shininess - 0.35f ) ) * 0.40f - 0.05f, 0.0f,
1416 return materialVector;
1421 const glm::mat4& aModelMatrix,
float aFPOpacity,
1422 bool aSkipMaterialInformation,
BOARD_ITEM* aBoardItem )
1425 wxASSERT( a3DModel !=
nullptr );
1427 if( a3DModel ==
nullptr )
1431 wxASSERT( a3DModel->
m_Meshes !=
nullptr );
1435 if( aFPOpacity > 1.0f )
1438 if( aFPOpacity < 0.0f )
1446 if( !aSkipMaterialInformation )
1451 const glm::mat3 normalMatrix = glm::transpose( glm::inverse( glm::mat3( aModelMatrix ) ) );
1453 for(
unsigned int mesh_i = 0; mesh_i < a3DModel->
m_MeshesSize; ++mesh_i )
1470 float fpTransparency;
1473 if( !aSkipMaterialInformation )
1482 for(
unsigned int faceIdx = 0; faceIdx < mesh.
m_FaceIdxSize; faceIdx += 3 )
1484 const unsigned int idx0 = mesh.
m_FaceIdx[faceIdx + 0];
1485 const unsigned int idx1 = mesh.
m_FaceIdx[faceIdx + 1];
1486 const unsigned int idx2 = mesh.
m_FaceIdx[faceIdx + 2];
1504 const SFVEC3F vt0 =
SFVEC3F( aModelMatrix * glm::vec4( v0, 1.0f ) );
1508 const SFVEC3F nt0 = glm::normalize(
SFVEC3F( normalMatrix * n0 ) );
1509 const SFVEC3F nt1 = glm::normalize(
SFVEC3F( normalMatrix * n1 ) );
1510 const SFVEC3F nt2 = glm::normalize(
SFVEC3F( normalMatrix * n2 ) );
1516 aDstContainer.
Add( newTriangle );
1518 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 outline 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.
BOARD_ADAPTER & m_boardAdapter
Settings reference in use for this render.
SILK_SCREEN_NORMAL m_silkScreenMaterial
void Reload(REPORTER *aStatusReporter, REPORTER *aWarningReporter, bool aOnlyLoadCopperAndShapes)
BOARD_NORMAL m_boardMaterial
CONTAINER_3D m_objectContainer
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
Store the list of created objects special for RT that will be clear in the end.
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 Fracture()
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.
void BooleanSubtract(const SHAPE_POLY_SET &b)
Perform boolean polyset difference.
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)
Test 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