Skip to content

IfcConvert enhancements#179

Merged
aothms merged 7 commits into
IfcOpenShell:masterfrom
Tridify:digits
Jan 14, 2017
Merged

IfcConvert enhancements#179
aothms merged 7 commits into
IfcOpenShell:masterfrom
Tridify:digits

Conversation

@Stinkfist0

@Stinkfist0 Stinkfist0 commented Jan 11, 2017

Copy link
Copy Markdown
Contributor

--precision
--model-offset
--unicode

re: #20 #73 #122

Sets the decimal precision to be used to format floating-point values, 15 by default.
Use a negative value to use the system's default precision (should be 6 typically).
Applicable for OBJ and DAE output. For DAE output, value >= 15 means that up to 16 decimals are used,
and any other value means that 6 or 7 decimals are used.
…erSettings::DEFAULT_PRECISION in order to fix compilation on GCC & Clang.
@Stinkfist0

Stinkfist0 commented Jan 12, 2017

Copy link
Copy Markdown
Contributor Author

I could also throw in the --model-offset feature to the same pull request soon or provide a new PR with it, whatever suits you the best. Edit: jumped the gun. ;)

@Stinkfist0 Stinkfist0 changed the title IfcConvert --precision option. IfcConvert --precision and --model-offset options Jan 12, 2017
@Stinkfist0

Copy link
Copy Markdown
Contributor Author

I could also squeeze in --unicode=escape|utf8 as it's pretty trivial, I should be done with in within an hour.

@Stinkfist0 Stinkfist0 changed the title IfcConvert --precision and --model-offset options IfcConvert enhancements Jan 13, 2017
@Stinkfist0

Copy link
Copy Markdown
Contributor Author

OK, that should be it for now.

offset[1] = -center.Y();
offset[2] = -center.Z();
} else {
if (sscanf(offset_str.c_str(), "%lf;%lf;%lf", &offset[0], &offset[1], &offset[2]) != 3) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if we need to do something with setlocale() here? I'm somewhat surprised that I need to use a dot as a decimal separator even though my OS is set to believe in the mainland European convention of using commas. It's a minor issue and I'm sure users can figure this out for themselves.

@aothms

aothms commented Jan 13, 2017

Copy link
Copy Markdown
Member

Wonderful, just waiting for your opinion on the locale thing and then I will merge it.

@Stinkfist0

Stinkfist0 commented Jan 14, 2017

Copy link
Copy Markdown
Contributor Author

Hmm, I'm suspecting we never set the locale explicitly anywhere; the default implicit locale for any C and C++ programs should be (IIRC) the C locale.

@aothms

aothms commented Jan 14, 2017

Copy link
Copy Markdown
Member

Yeah just I had to get too so much trouble to make 100% sure it is the C locale in the parser [1] that I got a bit allergic to this. But I suppose this is mostly for *nix users messing with LC_ALL that supposedly know what they are doing. Great!

[1] https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcparse/IfcParse.cpp#L48

@aothms aothms merged commit 77d5342 into IfcOpenShell:master Jan 14, 2017
Andrej730 added a commit that referenced this pull request Sep 6, 2024
to avoid issues importing csvs that used it to extract correct predefined type

Example warning:
WARNING. Assigning 'predefined_type' is not yet supported. Skipping value 'ELECTRICACTUATOR' for element: '#89=IfcActuator('1RjCen6XL6WAdhz7HumLFU',$,'Actuator.002',$,$,#179,$,$,.ELECTRICACTUATOR.)'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants