youshengCode / IfcToolbox

Simple tools for processing IFC files. Optimize, convert, split, relocate and anonymize IFC files easily.
GNU General Public License v3.0
89 stars 14 forks source link

Optimizer deletes materials #17

Open denizmaral opened 1 year ago

denizmaral commented 1 year ago

I launched the optimizer on the test file and I realized that it deleted materials. Ifc2x3_SampleCastle image

using IfcToolbox.Tools.Configurations;
using IfcToolbox.Tools.Processors;

Console.WriteLine("Optimizing the IFC file");
var filePath = args[0];
IConfigOptimize config = ConfigFactory.CreateConfigOptimize();
config.PrecisionOpen = true;
config.Precision = 4;
config.OptimizePoint = true;
config.OptimizePointList = true;
config.MergeOpen = true;
config.MergeOnlyResources = true;
config.MergeReversedEntities = true;
var result = OptimizerProcessor.Process(filePath, config, true);
Console.WriteLine(result.Success ? "Optimized successfully": "Could not optimized" );