KiCad PCB EDA Suite
exporter_vrml.cpp File Reference
#include <exception>
#include <fstream>
#include <iomanip>
#include <vector>
#include <wx/dir.h>
#include <wx/msgdlg.h>
#include <wx/wfstream.h>
#include <wx/zstream.h>
#include "3d_cache/3d_cache.h"
#include "3d_cache/3d_info.h"
#include "board.h"
#include "board_design_settings.h"
#include <fp_lib_table.h>
#include "fp_shape.h"
#include "footprint.h"
#include "pad.h"
#include "pcb_text.h"
#include "pcb_track.h"
#include <core/arraydim.h>
#include <filename_resolver.h>
#include "plugins/3dapi/ifsg_all.h"
#include "streamwrapper.h"
#include "vrml_layer.h"
#include "pcb_edit_frame.h"
#include <convert_basic_shapes_to_polygon.h>
#include <geometry/geometry_utils.h>
#include <macros.h>
#include <exporter_vrml.h>

Go to the source code of this file.

Macros

#define ERR_APPROX_MAX_MM   0.005
 
#define ADD_COLOR(list, r, g, b, a, name)    list.emplace_back( r/255.0, g/255.0, b/255.0, a, name )
 

Functions

static void build_quat (double x, double y, double z, double a, double q[4])
 
static void from_quat (double q[4], double rot[4])
 
static void compose_quat (double q1[4], double q2[4], double qr[4])
 

Variables

static bool g_ColorsLoaded = false
 

Macro Definition Documentation

◆ ADD_COLOR

#define ADD_COLOR (   list,
  r,
  g,
  b,
  a,
  name 
)     list.emplace_back( r/255.0, g/255.0, b/255.0, a, name )

◆ ERR_APPROX_MAX_MM

#define ERR_APPROX_MAX_MM   0.005

Definition at line 81 of file exporter_vrml.cpp.

Function Documentation

◆ build_quat()

static void build_quat ( double  x,
double  y,
double  z,
double  a,
double  q[4] 
)
static

Definition at line 950 of file exporter_vrml.cpp.

951{
952 double sina = sin( a / 2 );
953
954 q[0] = x * sina;
955 q[1] = y * sina;
956 q[2] = z * sina;
957 q[3] = cos( a / 2 );
958}

Referenced by EXPORTER_PCB_VRML::ExportVrmlFootprint().

◆ compose_quat()

static void compose_quat ( double  q1[4],
double  q2[4],
double  qr[4] 
)
static

Definition at line 972 of file exporter_vrml.cpp.

973{
974 double tmp[4];
975
976 tmp[0] = q2[3] * q1[0] + q2[0] * q1[3] + q2[1] * q1[2] - q2[2] * q1[1];
977 tmp[1] = q2[3] * q1[1] + q2[1] * q1[3] + q2[2] * q1[0] - q2[0] * q1[2];
978 tmp[2] = q2[3] * q1[2] + q2[2] * q1[3] + q2[0] * q1[1] - q2[1] * q1[0];
979 tmp[3] = q2[3] * q1[3] - q2[0] * q1[0] - q2[1] * q1[1] - q2[2] * q1[2];
980
981 qr[0] = tmp[0];
982 qr[1] = tmp[1];
983 qr[2] = tmp[2];
984 qr[3] = tmp[3];
985}

Referenced by EXPORTER_PCB_VRML::ExportVrmlFootprint().

◆ from_quat()

static void from_quat ( double  q[4],
double  rot[4] 
)
static

Definition at line 962 of file exporter_vrml.cpp.

963{
964 rot[3] = acos( q[3] ) * 2;
965
966 for( int i = 0; i < 3; i++ )
967 rot[i] = q[i] / sin( rot[3] / 2 );
968}

Referenced by EXPORTER_PCB_VRML::ExportVrmlFootprint().

Variable Documentation

◆ g_ColorsLoaded

bool g_ColorsLoaded = false
static

Definition at line 96 of file exporter_vrml.cpp.

Referenced by EXPORTER_PCB_VRML::initStaticColorList().