|
KiCad PCB EDA Suite
|
Go to the source code of this file.
Classes | |
| struct | EXTRUSION_MATERIAL_PROPS |
Functions | |
| BOX2I | CalcPlaceholderLocalBox (const FOOTPRINT *aFootprint) |
| Calculate a local space bounding box for a placeholder 3D model. | |
| bool | GetExtrusionOutline (const FOOTPRINT *aFootprint, SHAPE_POLY_SET &aOutline, PCB_LAYER_ID aLayerOverride=UNDEFINED_LAYER) |
| Get the extrusion outline polygon for a footprint in board coordinates. | |
| bool | GetExtrusionPinOutline (const FOOTPRINT *aFootprint, SHAPE_POLY_SET &aPinPoly) |
| Get the pin outline polygons for extruded THT pin rendering. | |
| EXTRUSION_MATERIAL_PROPS | GetMaterialProps (EXTRUSION_MATERIAL aMaterial, const SFVEC3F &aDiffuse) |
| void | ApplyExtrusionTransform (SHAPE_POLY_SET &aOutline, const EXTRUDED_3D_BODY *aBody, const VECTOR2I &aFpPos) |
| Apply 2D extrusion transforms (rotation, scale, offset) to an outline. | |
| void ApplyExtrusionTransform | ( | SHAPE_POLY_SET & | aOutline, |
| const EXTRUDED_3D_BODY * | aBody, | ||
| const VECTOR2I & | aFpPos ) |
Apply 2D extrusion transforms (rotation, scale, offset) to an outline.
Definition at line 384 of file 3d_placeholder_utils.cpp.
References DEGREES_T, EXTRUDED_3D_BODY::m_offset, EXTRUDED_3D_BODY::m_rotation, EXTRUDED_3D_BODY::m_scale, SHAPE_POLY_SET::Move(), pcbIUScale, SHAPE_POLY_SET::Rotate(), SHAPE_POLY_SET::Scale(), VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Referenced by RENDER_3D_RAYTRACE_BASE::addExtrudedBodyToRaytracer(), STEP_PCB_MODEL::AddExtrudedPins(), EXPORTER_STEP::buildFootprint3DShapes(), and RENDER_3D_OPENGL::renderExtrudedBodies().
Calculate a local space bounding box for a placeholder 3D model.
Attempts pads first, then graphical items on fab/courtyard/silk layers, then falls back to the footprint bounding box.
Definition at line 38 of file 3d_placeholder_utils.cpp.
References PADSTACK::ALL_LAYERS, B_CrtYd, B_Fab, B_SilkS, F_CrtYd, F_Fab, F_SilkS, BOX2< Vec >::GetBottom(), FOOTPRINT::GetBoundingBox(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), FOOTPRINT::GetOrientation(), BOX2< Vec >::GetOrigin(), FOOTPRINT::GetPosition(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), FOOTPRINT::GraphicalItems(), BOX2< Vec >::Merge(), pad, FOOTPRINT::Pads(), RotatePoint(), BOX2< Vec >::SetOrigin(), and BOX2< Vec >::SetSize().
Referenced by RENDER_3D_RAYTRACE_BASE::addPlaceholderToRaytracer(), buildPadBoundingBox(), and RENDER_3D_OPENGL::renderPlaceholderForFootprint().
| bool GetExtrusionOutline | ( | const FOOTPRINT * | aFootprint, |
| SHAPE_POLY_SET & | aOutline, | ||
| PCB_LAYER_ID | aLayerOverride = UNDEFINED_LAYER ) |
Get the extrusion outline polygon for a footprint in board coordinates.
| aFootprint | the footprint to extract an outline from. |
| aOutline | output polygon set. |
| aLayerOverride | when not UNDEFINED_LAYER, use this layer instead of the footprint's extruded body layer setting. |
Definition at line 260 of file 3d_placeholder_utils.cpp.
References SHAPE_POLY_SET::Append(), B_CrtYd, B_Fab, B_SilkS, buildFilledPolygonFromShapes(), buildPadBoundingBox(), F_CrtYd, F_Fab, F_SilkS, FlipLayer(), FOOTPRINT::GetCourtyard(), FOOTPRINT::GetExtrudedBody(), FOOTPRINT::GetReference(), FOOTPRINT::IsFlipped(), EXTRUDED_3D_BODY::m_layer, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::RemoveAllContours(), SHAPE_POLY_SET::Simplify(), UNDEFINED_LAYER, and UNSELECTED_LAYER.
Referenced by RENDER_3D_RAYTRACE_BASE::addExtrudedBodyToRaytracer(), EXPORTER_STEP::buildFootprint3DShapes(), PANEL_FP_PROPERTIES_3D_MODEL::OnExportExtrudedModel(), and RENDER_3D_OPENGL::renderExtrudedBodies().
| bool GetExtrusionPinOutline | ( | const FOOTPRINT * | aFootprint, |
| SHAPE_POLY_SET & | aPinPoly ) |
Get the pin outline polygons for extruded THT pin rendering.
Collects drill hole shapes from all pads with holes, shrunk to ~90% of the drill diameter so pins sit inside the hole.
Definition at line 348 of file 3d_placeholder_utils.cpp.
References ARC_HIGH_DEF, ERROR_INSIDE, SHAPE_POLY_SET::OutlineCount(), pad, FOOTPRINT::Pads(), SHAPE_POLY_SET::RemoveAllContours(), and SHAPE_POLY_SET::Simplify().
Referenced by RENDER_3D_RAYTRACE_BASE::addExtrudedBodyToRaytracer(), STEP_PCB_MODEL::AddExtrudedPins(), and RENDER_3D_OPENGL::renderExtrudedBodies().
| EXTRUSION_MATERIAL_PROPS GetMaterialProps | ( | EXTRUSION_MATERIAL | aMaterial, |
| const SFVEC3F & | aDiffuse ) |
Definition at line 369 of file 3d_placeholder_utils.cpp.
References COPPER, MATTE, METAL, and PLASTIC.
Referenced by RENDER_3D_RAYTRACE_BASE::addExtrudedBodyToRaytracer(), and RENDER_3D_OPENGL::Redraw().