[Feature Request] [nurbs] IGES Export - Unit Magnitude (mm instead of m)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Feature Request] [nurbs] IGES Export - Unit Magnitude (mm instead of m)

Adam Hirst
To whom it may concern,

I've been using the nurbs package for Octave for some time. It's a great
package, providing a convenient and powerful set of tools, which is also
readily portable with MATLAB users of the NURBS Toolbox. However, there
is one implementation detail which has me confused, and it's this I'd
like to mention here.

This package has the ability to export (and I believe also import,
though I don't use this) to IGES files. I use this as an intermediary
between my own code and CAD tools (with which I create models to verify
simulations). If I recall correctly, the interface is very similar
(though not identical) to one available for MATLAB, "NrbsSrf2IGES",
which colleagues and I have used. But with one difference: IGES files
from "NrbsSrf2IGES" use millimetres, but from here they use metres.

I assume this stems from the fact that, as far as I can tell, the
primary developers do something related to geophysics, which obviously
warrants a different scale to most engineering components. Nonetheless,
it would be nice if there were some way to configure this - as far as I
can tell, this isn't possible here. Manually editing the IGES files is
fiddly due to the awkwardness of the format, and I'd rather avoid having
to introduce conditional rescaling of my objects (either prior to
Export, or in my CAD scripts) if at all possible.

Is this an appropriate place to raise this concern? I spoke (admittedly
some time ago) about this on #octave (Freenode) and was recommended to
ask "the mailing list", which I'm finally getting around to now.

I very much look forward to your replies.

Best regards,

Adam Hirst, MPhys (Dunelm)




-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Feature Request] [nurbs] IGES Export - Unit Magnitude (mm instead of m)

jcorno
Dear Adam,

thanks for the feedback. I was the one writing the nrb2iges function and I
did not think of the problem at the time.

It might require some time to add options to the functions such that the
user can set whichever unit she/he prefers. In the meantime, one quick
solution would be to directly modify the function nrb2iges. To switch from
metres to millimetres it should be sufficient to change lines 61 and 62 of
the function in such a way:

G{14}= '2';                             % Unit Flag (2 = millimetres, 6 =
metres)
G{15}= HString('MM');             % Units  (millimetres = "MM, metres = "M")

You can find more information about the IGES file format specification, for
example, here:
https://filemonger.com/specs/igs/devdept.com/version6.pdf
on page 20 you will find all the flags for the different units...

I hope this was helpful. Best regards,
Jacopo Corno



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: [Feature Request] [nurbs] IGES Export - Unit Magnitude (mm instead of m)

Adam Hirst
Thanks for the reply. Yeah, there are quite a few different ways to go
about making this option configurable (should it be an environment
variable, an argument to the function itself, or even an entry in a
config file?), so I figured a discussion was the best way forward.

Yeah, I had considered changing my local version of the function, but
was aware that the IGES specification has loads of extra cruft like
ensuring line lengths etc, so wasn't sure whether changing an "M" to an
"MM" and the "6" to the "2" would break the logic in some other way. 
It's reassuring to know that this should work, and I will do this for
now as a stop-gap.

I'm keen to know how this develops, but in the meantime, thanks again.

Best regards,

Adam

P.S. You may have noticed that I posted this 3 times. After waiting
about half an hour after the first, I still hadn't received the list
copy, nor could I see it on the archive, so I figured something had gone
wrong, and sent it again. After another 20 minutes or so I still saw
nothing, so did it again. Then all three arrived at once. -_-


On 25/01/18 08:40, jcorno wrote:

> Dear Adam,
>
> thanks for the feedback. I was the one writing the nrb2iges function and I
> did not think of the problem at the time.
>
> It might require some time to add options to the functions such that the
> user can set whichever unit she/he prefers. In the meantime, one quick
> solution would be to directly modify the function nrb2iges. To switch from
> metres to millimetres it should be sufficient to change lines 61 and 62 of
> the function in such a way:
>
> G{14}= '2';                             % Unit Flag (2 = millimetres, 6 =
> metres)
> G{15}= HString('MM');             % Units  (millimetres = "MM, metres = "M")
>
> You can find more information about the IGES file format specification, for
> example, here:
> https://filemonger.com/specs/igs/devdept.com/version6.pdf
> on page 20 you will find all the flags for the different units...
>
> I hope this was helpful. Best regards,
> Jacopo Corno
>
>
>
> --
> Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
>
>
> -----------------------------------------
> Join us March 12-15 at CERN near Geneva
> Switzerland for OctConf 2018.  More info:
> https://wiki.octave.org/OctConf_2018
> -----------------------------------------



-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------

signature.asc (849 bytes) Download Attachment