Export VRML and IDF maintenance.
Fix minor bug in eeschema (opening a relative path does not work) (patch from HennerZeller).
This commit is contained in:
parent
1c5a997f82
commit
d5064b98a4
|
@ -205,7 +205,7 @@ bool EDA_APP::OnInit()
|
||||||
// wxSetWorkingDirectory does not like empty paths
|
// wxSetWorkingDirectory does not like empty paths
|
||||||
wxSetWorkingDirectory( filename.GetPath() );
|
wxSetWorkingDirectory( filename.GetPath() );
|
||||||
|
|
||||||
if( frame->LoadOneEEProject( filename.GetFullPath(), false ) )
|
if( frame->LoadOneEEProject( filename.GetFullName(), false ) )
|
||||||
frame->GetCanvas()->Refresh( true );
|
frame->GetCanvas()->Refresh( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
*
|
*
|
||||||
* 3. Export Graphics to Layer objects (see 3d_draw.cpp for clues) to ensure that custom
|
* 3. Export Graphics to Layer objects (see 3d_draw.cpp for clues) to ensure that custom
|
||||||
* tracks/fills/logos are rendered.
|
* tracks/fills/logos are rendered.
|
||||||
|
* module->TransformGraphicShapesWithClearanceToPolygonSet
|
||||||
*
|
*
|
||||||
* For mechanical correctness, we should use the following settings with arcs:
|
* For mechanical correctness, we should use the following settings with arcs:
|
||||||
* 1. max. deviation: the number of edges should be determined by the max.
|
* 1. max. deviation: the number of edges should be determined by the max.
|
||||||
|
@ -925,7 +926,8 @@ static void export_vrml_text_module( TEXTE_MODULE* module )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline )
|
static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline,
|
||||||
|
double aOrientation )
|
||||||
{
|
{
|
||||||
LAYER_NUM layer = aOutline->GetLayer();
|
LAYER_NUM layer = aOutline->GetLayer();
|
||||||
double x = aOutline->GetStart().x * aModel.scale + aModel.tx;
|
double x = aOutline->GetStart().x * aModel.scale + aModel.tx;
|
||||||
|
@ -936,6 +938,10 @@ static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline )
|
||||||
|
|
||||||
switch( aOutline->GetShape() )
|
switch( aOutline->GetShape() )
|
||||||
{
|
{
|
||||||
|
case S_SEGMENT:
|
||||||
|
export_vrml_line( aModel, layer, x, y, xf, yf, w );
|
||||||
|
break;
|
||||||
|
|
||||||
case S_ARC:
|
case S_ARC:
|
||||||
export_vrml_arc( aModel, layer, x, y, xf, yf, w, aOutline->GetAngle() / 10 );
|
export_vrml_arc( aModel, layer, x, y, xf, yf, w, aOutline->GetAngle() / 10 );
|
||||||
break;
|
break;
|
||||||
|
@ -944,8 +950,41 @@ static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline )
|
||||||
export_vrml_circle( aModel, layer, x, y, xf, yf, w );
|
export_vrml_circle( aModel, layer, x, y, xf, yf, w );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case S_POLYGON:
|
||||||
|
{
|
||||||
|
VRML_LAYER* vl;
|
||||||
|
|
||||||
|
if( !VRMLEXPORT::GetLayer( aModel, layer, &vl ) )
|
||||||
|
break;
|
||||||
|
|
||||||
|
int nvert = aOutline->GetPolyPoints().size();
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
if( nvert < 3 ) break;
|
||||||
|
|
||||||
|
int seg = vl->NewContour();
|
||||||
|
|
||||||
|
if( seg < 0 )
|
||||||
|
break;
|
||||||
|
|
||||||
|
while( i < nvert )
|
||||||
|
{
|
||||||
|
CPolyPt corner( aOutline->GetPolyPoints()[i] );
|
||||||
|
RotatePoint( &corner.x, &corner.y, aOrientation );
|
||||||
|
corner.x += aOutline->GetPosition().x;
|
||||||
|
corner.y += aOutline->GetPosition().y;
|
||||||
|
|
||||||
|
x = corner.x * aModel.scale + aModel.tx;
|
||||||
|
y = - ( corner.y * aModel.scale + aModel.ty );
|
||||||
|
vl->AddVertex( seg, x, y );
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
vl->EnsureWinding( seg, false );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
export_vrml_line( aModel, layer, x, y, xf, yf, w );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1134,7 +1173,8 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aModule
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_MODULE_EDGE_T:
|
case PCB_MODULE_EDGE_T:
|
||||||
export_vrml_edge_module( aModel, dynamic_cast<EDGE_MODULE*>( item ) );
|
export_vrml_edge_module( aModel, dynamic_cast<EDGE_MODULE*>( item ),
|
||||||
|
aModule->GetOrientation() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -177,7 +177,7 @@ int main( int argc, char **argv )
|
||||||
|
|
||||||
tstr.clear();
|
tstr.clear();
|
||||||
tstr.str( line );
|
tstr.str( line );
|
||||||
if( (tstr >> extraZ) && extraZ > 0.0 )
|
if( (tstr >> extraZ) && extraZ >= 0.0 )
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue