58 const float aaa = aTransparency * aTransparency * aTransparency;
61 float ca = 1.0f - aTransparency;
62 ca = 1.00f - 1.05f * ca * ca * ca;
64 return glm::max( glm::min( aGrayColorValue * ca + aaa, 1.0f ), 0.0f );
70#define UNITS3D_TO_UNITSPCB ( pcbIUScale.IU_PER_MM )
97 const SFVEC3F copperSpecularLinear =
103 SFVEC3F( 0.0f ), copperSpecularLinear, 0.4f * 128.0f, 0.0f, 0.0f );
110 SFVEC3F( 0.256f, 0.137f, 0.086f ), 0.15f * 128.0f, 0.0f, 0.0f );
122 0.10f * 128.0f, 0.0f, 0.0f );
128 SFVEC3F( 0.0f ),
SFVEC3F( 0.10f ) ), 0.078125f * 128.0f, 0.0f, 0.0f );
134 const float solderMask_gray =
145 SFVEC3F( glm::clamp( solderMask_gray * 2.0f, 0.25f, 1.0f ) ), 0.85f * 128.0f,
146 solderMask_transparency, 0.16f );
149 m_materials.m_SolderMask.SetRefractionRayCount( 1 );
170 (
SFVEC3F( 1.0f ) - bgTop ) / 3.0f,
171 0.10f * 128.0f, 0.0f, 0.50f );
173 m_materials.m_Floor.SetReflectionRecursionCount( 1 );
178 float aZMin,
float aZMax,
const MATERIAL* aMaterial,
193 aDstContainer.
Add( objPtr );
200 aDstContainer.
Add( objPtr );
212 aDstContainer.
Add( objPtr );
221 aDstContainer.
Add( objPtr );
232 float aLayerZOffset )
234 if( aContainer2d ==
nullptr )
239 if( listObject2d.size() == 0 )
242 for(
const OBJECT_2D* object2d_A : listObject2d )
250 object2d_B =
new std::vector<const OBJECT_2D*>();
260 if( layerHolesMap.find( aLayer_id ) != layerHolesMap.end() )
268 for(
const OBJECT_2D* hole2d : intersecting )
269 object2d_B->push_back( hole2d );
282 if( !throughHoleOuter.
GetList().empty() )
288 for(
const OBJECT_2D* hole2d : intersecting )
289 object2d_B->push_back( hole2d );
300 for(
const OBJECT_2D* obj : intersecting )
301 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() ) ) )
313 const BVH_CONTAINER_2D* containerMaskLayer2d = mapLayers.at( layerMask_id );
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" ) );
396 if( !aOnlyLoadCopperAndShapes )
400 if( outlineCount > 0 )
402 float divFactor = 0.0f;
419 for(
int ii = 0; ii < antiboardPoly.
OutlineCount(); ii++ )
430 for(
int ii = 0; ii < outlineCount; ii++ )
441 for(
const OBJECT_2D* object2d_A : listObjects )
443 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
453 for(
const OBJECT_2D* hole : intersecting )
455 if( object2d_A->Intersects( hole->GetBBox() ) )
456 object2d_B->push_back( hole );
467 for(
const OBJECT_2D* obj : intersecting )
468 object2d_B->push_back( obj );
471 if( object2d_B->empty() )
516 for(
const OBJECT_2D* hole2d : holeList )
526 if( !intersecting.empty() )
530 switch( hole2d->GetObjectType() )
534 const float radius = hole2d->GetBBox().GetExtent().x * 0.5f * 0.999f;
557 if( aStatusReporter )
558 aStatusReporter->
Report(
_(
"Load Raytracing: layers" ) );
638 layerColor =
SFVEC3F( 184.0f / 255.0f, 115.0f / 255.0f, 50.0f / 255.0f );
671 if( !aOnlyLoadCopperAndShapes )
715 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
725 for(
const OBJECT_2D* hole : intersecting )
727 if( object2d_A->Intersects( hole->GetBBox() ) )
728 object2d_B->push_back( hole );
734 if( !container2d->
GetList().empty() )
740 for(
const OBJECT_2D* obj : intersecting )
741 object2d_B->push_back( obj );
744 if( object2d_B->empty() )
754 materialLayer, layerColor );
768 object2d_A->GetBoardItem() );
785#ifdef PRINT_STATISTICS_3D_VIEWER
787 unsigned stats_startLoad3DmodelsTime = stats_endConvertTime;
790 if( aStatusReporter )
791 aStatusReporter->
Report(
_(
"Loading 3D models..." ) );
795#ifdef PRINT_STATISTICS_3D_VIEWER
799 if( !aOnlyLoadCopperAndShapes )
808 boardBBox.
Scale( 3.0f );
814 containerBBox.
Scale( 1.3f );
819 const float minZ = glm::min( containerBBox.
Min().z, boardBBox.
Min().z );
823 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
827 +
SFVEC3F( centerBBox.x, centerBBox.y, 0.0f );
843 newTriangle1->
SetColor( backgroundColor );
844 newTriangle2->
SetColor( backgroundColor );
847 const float maxZ = glm::max( containerBBox.
Max().z, boardBBox.
Max().z );
863 newTriangle3->
SetColor( backgroundColor );
864 newTriangle4->
SetColor( backgroundColor );
878 return ( ( aSource.r < ( 1.0f / 255.0f ) ) && ( aSource.g < ( 1.0f / 255.0f ) )
879 && ( aSource.b < ( 1.0f / 255.0f ) ) );
892 if( !IsColorZero( cameraLightColor ) )
897 if( !IsColorZero( topLightColor ) )
904 if( !IsColorZero( bottomLightColor ) )
908 bottomLightColor ) );
916 if( !IsColorZero( lightColor ) )
944 if( aStatusReporter )
959 aVia->
LayerPair( &top_layer, &bottom_layer );
1005 const bool hasHole = drillsize.
x && drillsize.
y;
1018 if( drillsize.
x == drillsize.
y )
1023 int innerRadius = drillsize.
x / 2;
1038 antiOutlineIntersectionList );
1041 if( !antiOutlineIntersectionList.empty() )
1048 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1049 object2d_B->push_back( innerCircle );
1058 object2d_A = itemCSG2d;
1066 if( drillsize.
x > drillsize.
y )
1068 ends_offset.
x = ( drillsize.
x - drillsize.
y ) / 2;
1069 width = drillsize.
y;
1073 ends_offset.
y = ( drillsize.
y - drillsize.
x ) / 2;
1074 width = drillsize.
x;
1098 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1099 object2d_B->push_back( innerSeg );
1107 object2d_A = itemCSG2d;
1112 antiOutlineIntersectionList );
1118 std::vector<const OBJECT_2D*>* object2d_B =
new std::vector<const OBJECT_2D*>();
1129 for(
const OBJECT_2D* hole2d : intersecting )
1131 if( object2d_A->
Intersects( hole2d->GetBBox() ) )
1132 object2d_B->push_back( hole2d );
1136 for(
const OBJECT_2D* obj : antiOutlineIntersectionList )
1137 object2d_B->push_back( obj );
1139 if( object2d_B->empty() )
1191 for(
PAD*
pad : footprint->Pads() )
1215 if( !fp->Models().empty()
1222 glm::mat4 fpMatrix = glm::mat4( 1.0f );
1224 fpMatrix = glm::translate( fpMatrix,
1229 if( !fp->GetOrientation().IsZero() )
1231 fpMatrix = glm::rotate( fpMatrix, (
float) fp->GetOrientation().AsRadians(),
1232 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1235 if( fp->IsFlipped() )
1237 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1239 fpMatrix = glm::rotate( fpMatrix, glm::pi<float>(),
SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1242 const double modelunit_to_3d_units_factor =
1246 fpMatrix,
SFVEC3F( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor,
1247 modelunit_to_3d_units_factor ) );
1253 auto sM = fp->Models().begin();
1254 auto eM = fp->Models().end();
1256 wxString libraryName = fp->GetFPID().GetLibNickname();
1258 wxString footprintBasePath = wxEmptyString;
1266 libraryName,
false );
1269 footprintBasePath = fpRow->
GetFullURI(
true );
1279 if( (
static_cast<float>( sM->m_Opacity ) > FLT_EPSILON )
1280 && ( sM->m_Show && !sM->m_Filename.empty() ) )
1284 cacheMgr->
GetModel( sM->m_Filename, footprintBasePath );
1289 glm::mat4 modelMatrix = fpMatrix;
1291 modelMatrix = glm::translate( modelMatrix,
1292 SFVEC3F( sM->m_Offset.x, sM->m_Offset.y, sM->m_Offset.z ) );
1294 modelMatrix = glm::rotate( modelMatrix,
1295 (
float) -( sM->m_Rotation.z / 180.0f ) * glm::pi<float>(),
1296 SFVEC3F( 0.0f, 0.0f, 1.0f ) );
1298 modelMatrix = glm::rotate( modelMatrix,
1299 (
float) -( sM->m_Rotation.y / 180.0f ) * glm::pi<float>(),
1300 SFVEC3F( 0.0f, 1.0f, 0.0f ) );
1302 modelMatrix = glm::rotate( modelMatrix,
1303 (
float) -( sM->m_Rotation.x / 180.0f ) * glm::pi<float>(),
1304 SFVEC3F( 1.0f, 0.0f, 0.0f ) );
1307 SFVEC3F( sM->m_Scale.x, sM->m_Scale.y, sM->m_Scale.z ) );
1309 addModels( aDstContainer, modelPtr, modelMatrix, (
float) sM->m_Opacity,
1310 aSkipMaterialInformation, boardItem );
1341 for(
unsigned int imat = 0; imat < a3DModel->
m_MaterialsSize; ++imat )
1349 float reflectionFactor = 0.0f;
1351 if( ( material.
m_Shininess - 0.35f ) > FLT_EPSILON )
1353 reflectionFactor = glm::clamp(
1354 glm::sqrt( ( material.
m_Shininess - 0.35f ) ) * 0.40f - 0.05f, 0.0f,
1420 return materialVector;
1425 const glm::mat4& aModelMatrix,
float aFPOpacity,
1426 bool aSkipMaterialInformation,
BOARD_ITEM* aBoardItem )
1429 wxASSERT( a3DModel !=
nullptr );
1431 if( a3DModel ==
nullptr )
1435 wxASSERT( a3DModel->
m_Meshes !=
nullptr );
1438 wxASSERT( aFPOpacity > 0.0f );
1439 wxASSERT( aFPOpacity <= 1.0f );
1441 if( aFPOpacity > 1.0f )
1451 if( !aSkipMaterialInformation )
1456 const glm::mat3 normalMatrix = glm::transpose( glm::inverse( glm::mat3( aModelMatrix ) ) );
1458 for(
unsigned int mesh_i = 0; mesh_i < a3DModel->
m_MeshesSize; ++mesh_i )
1475 float fpTransparency;
1478 if( !aSkipMaterialInformation )
1487 for(
unsigned int faceIdx = 0; faceIdx < mesh.
m_FaceIdxSize; faceIdx += 3 )
1489 const unsigned int idx0 = mesh.
m_FaceIdx[faceIdx + 0];
1490 const unsigned int idx1 = mesh.
m_FaceIdx[faceIdx + 1];
1491 const unsigned int idx2 = mesh.
m_FaceIdx[faceIdx + 2];
1509 const SFVEC3F vt0 =
SFVEC3F( aModelMatrix * glm::vec4( v0, 1.0f ) );
1513 const SFVEC3F nt0 = glm::normalize(
SFVEC3F( normalMatrix * n0 ) );
1514 const SFVEC3F nt1 = glm::normalize(
SFVEC3F( normalMatrix * n1 ) );
1515 const SFVEC3F nt2 = glm::normalize(
SFVEC3F( normalMatrix * n2 ) );
1521 aDstContainer.
Add( newTriangle );
1523 if( !aSkipMaterialInformation )
@ NORMAL
Use all material properties from model file.
@ CAD_MODE
Use a gray shading based on diffuse material.
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.
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
const BVH_CONTAINER_2D & GetThroughHoleIds() const noexcept
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.
float GetLayerBottomZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the bottom z position.
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 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 )
SFVEC4F GetItemColor(int aItemId) const
Get the technical color of a layer.
const BVH_CONTAINER_2D * GetPlatedPadsFront() const noexcept
const BVH_CONTAINER_2D & GetThroughHoleAnnularRings() 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
const BVH_CONTAINER_2D & GetThroughHoleOds() const noexcept
SFVEC4F GetLayerColor(PCB_LAYER_ID aLayerId) const
Get the technical color of a layer.
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.
FOOTPRINTS & Footprints()
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 th...
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)
const void SetBoardItem(BOARD_ITEM *aBoardItem)
void SetModelTransparency(float aModelTransparency)
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
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
VIATYPE GetViaType() 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...
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....
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
CAMERA & m_camera
Flag if the opengl specific for this render was already initialized.
bool m_reloadRequested
The window size that this camera is working.
BOARD_ADAPTER & m_boardAdapter
DIRECTIONAL_LIGHT * m_cameraLight
PLATED_COPPER_NORMAL m_platedCopperMaterial
SOLDER_MASK_NORMAL m_solderMaskMaterial
void load3DModels(CONTAINER_3D &aDstContainer, bool aSkipMaterialInformation)
unsigned int m_converted2dRoundSegmentCount
void createItemsFromContainer(const BVH_CONTAINER_2D *aContainer2d, PCB_LAYER_ID aLayer_id, const MATERIAL *aMaterialLayer, const SFVEC3F &aLayerColor, float aLayerZOffset)
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.
MODEL_MATERIALS * getModelMaterial(const S3DMODEL *a3DModel)
BRUSHED_METAL_NORMAL m_brushedMetalMaterial
PLASTIC_SHINE_NORMAL m_shinyPlasticMaterial
CONTAINER_2D * m_outlineBoard2dObjects
struct RENDER_3D_RAYTRACE::@5 m_materials
ACCELERATOR_3D * m_accelerator
unsigned int m_convertedDummyBlockCount
void addModels(CONTAINER_3D &aDstContainer, const S3DMODEL *a3DModel, const glm::mat4 &aModelMatrix, float aFPOpacity, bool aSkipMaterialInformation, BOARD_ITEM *aBoardItem)
PLASTIC_NORMAL m_plasticMaterial
SILK_SCREEN_NORMAL m_silkScreenMaterial
CONTAINER_3D m_objectContainer
Store the list of created objects special for RT that will be clear in the end.
BOARD_NORMAL m_boardMaterial
CONTAINER_2D m_containerWithObjectsToDelete
std::list< LIGHT * > m_lights
static constexpr float MIN_DISTANCE_IU
void Reload(REPORTER *aStatusReporter, REPORTER *aWarningReporter, bool aOnlyLoadCopperAndShapes)
MAP_MODEL_MATERIALS m_modelMaterialMap
Stores materials of the 3D models.
BVH_CONTAINER_2D * m_antioutlineBoard2dObjects
void insertHole(const PCB_VIA *aVia)
COPPER_NORMAL m_copperMaterial
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)
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 intersection For aFastMode meaning, see function booleanOp.
void Fracture(POLYGON_MODE aFastMode)
Convert a single outline slitted ("fractured") polygon into a set ouf outlines with holes.
int OutlineCount() const
Return the number of vertices in a given outline/hole.
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
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
@ LAYER_PADS_TH
multilayer pads, usually with holes
@ LAYER_VIA_MICROVIA
to draw micro vias
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
@ LAYER_VIA_BBLIND
to draw blind/buried vias
PCB_LAYER_ID
A quick note on layer IDs:
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ NPTH
like PAD_PTH, but not plated
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...
unsigned GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
#define UNITS3D_TO_UNITSPCB
Scale conversion from 3d model units to pcb units.
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 show_footprints_virtual
int raytrace_nrsamples_reflections
bool subtract_mask_from_silk
bool renderPlatedPadsAsPlated
int raytrace_recursivelevel_reflections
int raytrace_nrsamples_refractions
bool raytrace_procedural_textures
bool show_footprints_insert
int raytrace_recursivelevel_refractions
KIGFX::COLOR4D raytrace_lightColorTop
bool clip_silk_on_via_annulus
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.
VECTOR2I v2(1, 0)
Test suite for KiCad math code.
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)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)