KiCad PCB EDA Suite
export_vrml.cpp File Reference
#include <exception>
#include <fstream>
#include <iomanip>
#include <vector>
#include <wx/dir.h>
#include <wx/msgdlg.h>
#include "3d_cache/3d_cache.h"
#include "3d_cache/3d_info.h"
#include "board.h"
#include "board_design_settings.h"
#include "fp_shape.h"
#include "footprint.h"
#include "pad.h"
#include "pcb_text.h"
#include "pcb_track.h"
#include "convert_to_biu.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.

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 EXPORTER_PCB_VRMLmodel_vrml
 
static const double err_approx_max = 0.005
 

Function Documentation

◆ build_quat()

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

Definition at line 727 of file export_vrml.cpp.

728 {
729  double sina = sin( a / 2 );
730 
731  q[0] = x * sina;
732  q[1] = y * sina;
733  q[2] = z * sina;
734  q[3] = cos( a / 2 );
735 }

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 749 of file export_vrml.cpp.

750 {
751  double tmp[4];
752 
753  tmp[0] = q2[3] * q1[0] + q2[0] * q1[3] + q2[1] * q1[2] - q2[2] * q1[1];
754  tmp[1] = q2[3] * q1[1] + q2[1] * q1[3] + q2[2] * q1[0] - q2[0] * q1[2];
755  tmp[2] = q2[3] * q1[2] + q2[2] * q1[3] + q2[0] * q1[1] - q2[1] * q1[0];
756  tmp[3] = q2[3] * q1[3] - q2[0] * q1[0] - q2[1] * q1[1] - q2[2] * q1[2];
757 
758  qr[0] = tmp[0];
759  qr[1] = tmp[1];
760  qr[2] = tmp[2];
761  qr[3] = tmp[3];
762 }

Referenced by EXPORTER_PCB_VRML::ExportVrmlFootprint().

◆ from_quat()

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

Definition at line 739 of file export_vrml.cpp.

740 {
741  rot[3] = acos( q[3] ) * 2;
742 
743  for( int i = 0; i < 3; i++ )
744  rot[i] = q[i] / sin( rot[3] / 2 );
745 }

Referenced by EXPORTER_PCB_VRML::ExportVrmlFootprint().

Variable Documentation

◆ err_approx_max

const double err_approx_max = 0.005
static

◆ model_vrml

EXPORTER_PCB_VRML* model_vrml
static

Definition at line 231 of file export_vrml.cpp.

Referenced by PCB_EDIT_FRAME::ExportVRML_File().