Oops, don't export construction lines. And we can't do exact curves

with cutter radius offset, and 2 pixels is a better default chord 
tolerance than 1.

[git-p4: depot-paths = "//depot/solvespace/": change = 1939]
This commit is contained in:
Jonathan Westhues 2009-04-15 20:42:51 -08:00
parent 3ca2a6b80b
commit 16de9a485a
3 changed files with 22 additions and 12 deletions

View File

@ -68,7 +68,8 @@ void SolveSpace::ExportSectionTo(char *filename) {
ZERO(&bl);
g->runningShell.MakeSectionEdgesInto(n, d,
&el, SS.exportPwlCurves ? NULL : &bl);
&el,
(SS.exportPwlCurves || fabs(SS.exportOffset) > LENGTH_EPS) ? NULL : &bl);
el.CullExtraneousEdges();
bl.CullIdenticalBeziers();
@ -103,10 +104,14 @@ void SolveSpace::ExportViewTo(char *filename) {
for(i = 0; i < SS.entity.n; i++) {
Entity *e = &(SS.entity.elem[i]);
if(!e->IsVisible()) continue;
if(e->construction) continue;
if(SS.exportPwlCurves || (sm && !SS.GW.showHdnLines)) {
if(SS.exportPwlCurves || (sm && !SS.GW.showHdnLines) ||
fabs(SS.exportOffset) > LENGTH_EPS)
{
// We will be doing hidden line removal, which we can't do on
// exact curves; so we need things broken down to pwls.
// exact curves; so we need things broken down to pwls. Same
// problem with cutter radius compensation.
e->GenerateEdges(&edges);
} else {
e->GenerateBezierCurves(&beziers);

View File

@ -39,7 +39,7 @@ void SolveSpace::Init(char *cmdLine) {
lightDir[1].y = CnfThawFloat( 0.0f, "LightDir_1_Up" );
lightDir[1].z = CnfThawFloat( 0.0f, "LightDir_1_Forward" );
// Chord tolerance
chordTol = CnfThawFloat(1.0f, "ChordTolerance");
chordTol = CnfThawFloat(2.0f, "ChordTolerance");
// Max pwl segments to generate
maxSegments = CnfThawDWORD(40, "MaxSegments");
// View units

View File

@ -681,14 +681,19 @@ void TextWindow::ShowConfiguration(void) {
&ScreenChangeShadedTriangles,
(!SS.exportShadedTriangles ? "" : "no"),
(!SS.exportShadedTriangles ? "no" : ""));
Printf(false, "%Ft curves as piecewise linear: "
"%Fh%f%Ll%s%E%Fs%s%E / %Fh%f%Ll%s%E%Fs%s%E",
&ScreenChangePwlCurves,
(SS.exportPwlCurves ? "" : "yes"),
(SS.exportPwlCurves ? "yes" : ""),
&ScreenChangePwlCurves,
(!SS.exportPwlCurves ? "" : "no"),
(!SS.exportPwlCurves ? "no" : ""));
if(fabs(SS.exportOffset) > LENGTH_EPS) {
Printf(false, "%Ft curves as piecewise linear:%E %Fsyes");
Printf(false, " (always pwl if cutter radius offset isn't 0)");
} else {
Printf(false, "%Ft curves as piecewise linear: "
"%Fh%f%Ll%s%E%Fs%s%E / %Fh%f%Ll%s%E%Fs%s%E",
&ScreenChangePwlCurves,
(SS.exportPwlCurves ? "" : "yes"),
(SS.exportPwlCurves ? "yes" : ""),
&ScreenChangePwlCurves,
(!SS.exportPwlCurves ? "" : "no"),
(!SS.exportPwlCurves ? "no" : ""));
}
Printf(false, "");
Printf(false, "%Ft draw back faces: "