1- // By and copyright Julian D. A. Wiseman of www.jdawiseman.com, April 2025
1+ // By and copyright Julian D. A. Wiseman of www.jdawiseman.com, June 2025
22// Released under GNU General Public License, Version 3, https://www.gnu.org/licenses/gpl-3.0.txt
33// main.c, in PenroseC
44
77// Change to match your directory structure, and location of applications.
88static char const filePath_staticConst [] = "/Users/JDAW/Documents/outputPenrose/" ;
99
10- #define AnyPostProcessing false
10+ #define AnyPostProcessing true
1111
1212// Location and name of application should match your machine's arrangement. Or can become empty do-nothing.
1313void execute_SVG_PostProcessing (
@@ -23,9 +23,9 @@ void execute_SVG_PostProcessing(
2323 {
2424 if ( ef == SVG_arcs || numCharsThisFile < 10737418240 ) // 10 MiB. Limit very different for arcs and rhombi. https://issues.chromium.org/issues/390969197
2525 {
26- // Change next line to invoke your preferred browser.
26+ // Change next line to invoke your preferred browser or SVG viewer .
2727 sprintf (scratchString , "open -a '/Applications/Google Chrome.app' 'file://%s'" , fileName );
28- system (scratchString ); // In general, system() can be a serious security risk. If concerned , delete.
28+ system (scratchString ); // In general, system() can be a serious security risk. If unable to be sure of safety , delete.
2929 } // Not too big
3030 } // AnyPostProcessing
3131} // execute_SVG_PostProcessing()
@@ -44,7 +44,7 @@ void execute_PostScript_PostProcessing(
4444 {
4545 // Change next line to invoke your preferred PS-to-PDF application, likely either Distiller or GhostScript.
4646 sprintf (scratchString , "open -a '/Applications/Adobe_Acrobat_2020_20240514/Acrobat Distiller.app' '%s'" , fileName );
47- system (scratchString ); // In general, system() can be a serious security risk. If concerned , delete.
47+ system (scratchString ); // In general, system() can be a serious security risk. If unable to be sure of safety , delete.
4848 } // AnyPostProcessing
4949} // execute_PostScript_PostProcessing()
5050
@@ -61,27 +61,61 @@ bool exportQ(ExportWhat const exprtWhat, ExportFormat const exportFormat, cons
6161 return ( true );
6262
6363 case PS_data :
64- return ( tlngP -> tilingId == tlngP -> numTilings - 1 );
64+ return (
65+ tlngP -> tilingId == tlngP -> numTilings - 1 // Last lap only
66+ && ( tlngP -> tilingId <= 15 || exprtWhat != boundingPath ) // At 15, bounding path has 20k points, so array of length about 60k.
67+ );
68+
69+ case PS_rhomb :
70+ case PS_arcs :
71+ return ( tlngP -> tilingId >= -1 ); // Null condition, always true, easily changed.
6572
6673 case SVG_rhomb :
67- case SVG_arcs :
68- return ( tlngP -> tilingId >= -1 ); // Null condition, always true
74+ if ( tlngP -> tilingId >= -1 ) // Null condition, always true, easily changed.
75+ {
76+ switch (exprtWhat )
77+ {
78+ case anything :
79+ case rhombi :
80+ return true;
81+ case boundingPath :
82+ return false; // different to SVG_arcs
83+
84+ case pathStats :
85+ case paths :
86+ return false; // This never reached; included to quieten compiler grumbling.
87+ } // switch(exprtWhat)
88+ }
6989
70- case PS_arcs :
71- case PS_rhomb :
72- return ( tlngP -> tilingId >= -1 ); // Null condition, always true
90+ case SVG_arcs :
91+ if ( tlngP -> tilingId >= -1 ) // Null condition, always true
92+ {
93+ switch (exprtWhat )
94+ {
95+ case anything :
96+ case rhombi :
97+ case boundingPath :
98+ return true;
99+
100+ case pathStats :
101+ case paths :
102+ return false; // This never reached; included to supress compiler grumbling.
103+ } // switch(exprtWhat)
104+ }
73105
74106 case TSV :
75107 switch (exprtWhat )
76108 {
77- case Anything :
109+ case anything :
78110 return ( 18 + numLinesThisFile < ExcelMaxNumRows );
79111 case pathStats :
80112 return ( 10 + numLinesThisFile + tlngP -> numPathStats < ExcelMaxNumRows );
81- case Paths :
113+ case paths :
82114 return ( 10 + numLinesThisFile + tlngP -> numPathsClosed + tlngP -> numPathsOpen < ExcelMaxNumRows - 10240 ); // Leaving space for subsequent pathStats
83- case Rhombi :
115+ case rhombi :
84116 return ( 10 + numLinesThisFile + tlngP -> numFats + tlngP -> numThins < ExcelMaxNumRows - 10240 ); // Leaving space for subsequent pathStats
117+ case boundingPath :
118+ return ( 10 + numLinesThisFile + 5 * sqrt (tlngP -> numFats + tlngP -> numThins ) < ExcelMaxNumRows - 10240 ); // Leaving space for subsequent pathStats
85119 } // switch(exprtWhat)
86120 break ; // Redundant
87121
@@ -135,12 +169,18 @@ bool rhombus_keep(
135169)
136170{
137171 return true;
138- // Example alternative:
139- // return xNorth > (-1 * tlngP->edgeLength);
172+ // Example alternative: return xNorth > (-1 * tlngP->edgeLength);
140173} // rhombus_keep
141174
142175
143176
177+ bool file_names_include_timeString (void )
178+ {
179+ return false;
180+ } // file_names_include_timeString()
181+
182+
183+
144184// Wrappers
145185const char * filePath (void )
146186{
0 commit comments