Giter Site home page Giter Site logo

fougue / gmio Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 8.0 1.8 MB

C library for geometry input/output

License: BSD 2-Clause "Simplified" License

C 72.97% C++ 19.79% CMake 5.65% Shell 0.25% Objective-C 0.63% Ruby 0.22% Batchfile 0.50%
amf c geometry io mesh opencascade stl

gmio's People

Contributors

huguesdelorme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gmio's Issues

AMF: instance subelements don't respect specified float64 format/precision

When exporting AMF contents the deltax, deltay, .... subelements values don't respect the float64 precision indicated in gmio_amf_write_options::float64_prec

Example :
float64_prec = 4

<?xml version="1.0" encoding="UTF-8"?>
<amf unit="millimeter" version="1.2">
<material id="0">
<color><r>1.0000</r><g>1.0000</g><b>1.0000</b><a>0.0000</a></color>
</material>
<material id="1">
<color><r>1.0000</r><g>0.0000</g><b>0.0000</b><a>0.0000</a></color>
</material>
...
<constellation id="0">
<instance objectid="0"><deltax>175.0000000000000</deltax><deltay>67.50000000000000</deltay><deltaz>70.00000000000000</deltaz><rx>0.000000000000000</rx><ry>90.00000000000000</ry><rz>0.000000000000000</rz></instance>
<instance objectid="0"><deltax>2.000000000000000</deltax><deltay>67.50000000000000</deltay><deltaz>70.00000000000000</deltaz><rx>0.000000000000000</rx><ry>90.00000000000000</ry><rz>0.000000000000000</rz></instance>
...

Early investigation shows this is caused by the call to gmio_ostringstream_write_xmlelt_f64() which internally passes NULL to gmio_ostringstream_write_f64().

Core: wrong error code name GMIO_ERROR_TRANSFER_STOPPED

The error code GMIO_ERROR_TRANSFER_STOPPED refers to gmio_transfer which was an ancient struct replaced by gmio_task_iface.
GMIO_ERROR_TRANSFER_STOPPED should be renamed to GMIO_ERROR_TASK_STOPPED for consistency. Adapt also documentation.

cmake fails to find snprintf() and other C99 functions with Visual C++ 2015

During configuration, cmake check_function_exists() fails for snprintf(), strtof(), ... although thoses functions are clearly available with Visual C++ 2015.
Actually Visual C++ 2015 moved stdio functions to the header files as inline functions, then check_function_exists() can't detect them because it doesn't use header files.

STL: segfault in function gmio_stl_infos_probe()

Function gmio_stl_infos_probe() causes a segfault when the following conditions are met :

  • Data format is STL ascii
  • Input flag GMIO_STLA_INFO_FLAG_SOLIDNAME is on
  • Input gmio_stl_infos::stla_solidname is NULL

STL: error when reading file containing multiple STL solids

After having read the last STL solid from a stream gmio_stl_read() returns GMIO_STL_ERROR_UNKNOWN_FORMAT.
The code pattern to read multiple STL solids from a stream is the following :

        int error = GMIO_ERROR_OK;
        struct gmio_stream stream = gmio_stream_stdio(infile);
        struct gmio_stl_read_options roptions = {0};
        struct gmio_stl_mesh_creator mesh_creator = /* Init here */
        roptions.func_stla_get_streamsize = gmio_stla_infos_get_streamsize;
        while (gmio_no_error(error) && !gmio_stream_at_end(&stream)) {
            error = gmio_stl_read(&stream, &mesh_creator, &roptions);
        }

This happens either for STL ASCII or binary contents. Actually gmio reads correctly but just after the last solid the stream is not exhausted and gmio attempts to read some empty stuff.
gmio_stl_read() should position the stream "at end" after the last solid was read.

Support: gmio_stl_mesh_occmesh::init_cache() error when compiling using oce 6.8.0

Hi there. After a time working with oce toolkit to read stl I decided to look for something faster and I find gmio, which has a excellent benchmark.

But I have a problem when I try to compile using gcc 4.8.3 and oce 6.8.0.

The problem occurs when the g++ tries compile the gmio_support/stl_occ_mesh.cpp in the function
gmio_stl_mesh_occmesh::init_cache() (lines 104, 105, 106, 107, 109 and 120)

domdata.vec_coords.reserve(seq_vertices.Size());
typedef TColgp_SequenceOfXYZ::const_iterator ConstIterSeqXYZ; 
const ConstIterSeqXYZ seq_end = seq_vertices.cend(); 
for (ConstIterSeqXYZ it = seq_vertices.cbegin(); it != seq_end; ++it) 
      domdata.vec_coords.push_back(&(*it)); 
m_vec_domain_data.push_back(std::move(domdata)); 
stl_occ_mesh.cpp:104:49: error: within this context domdata.vec_coords.reserve(seq_vertices.Size());

stl_occ_mesh.cpp:106:15: error: 'ConstIterSeqXYZ' does not name a type  const ConstIterSeqXYZ seq_end = seq_vertices.cend();

You are using opencascade 6.8.0 from github?

Thanks in advance.

Felipe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.