Creating a mesh with entmake

Hi,

I wrote a small tool, which is creating 3D-meshes to import the object from my software. It is working well with AutoCAD and Draftsight, and as far as I know, with ZwCAD too. But BricsCAD crashes on my development system.

I add a small example here, which can get copied and pasted to give it a try:

That is a simple cuboid as list, which is passed as parameter to entmake:
( (0 . "MESH") (100 . "AcDbEntity") (100 . "AcDbSubDMesh") (71 . 2) (72 . 0) (91 . 0) (92 . 8) (10 1700.0 225.0 0.0) (10 2300.0 225.0 0.0) (10 2300.0 -225.0 0.0) (10 1700.0 -225.0 0.0) (10 1700.0 -225.0 -275.0) (10 2300.0 -225.0 -275.0) (10 2300.0 225.0 -275.0) (10 1700.0 225.0 -275.0) (93 . 30) (90 . 4) (90 . 0) (90 . 1) (90 . 2) (90 . 3) (90 . 4) (90 . 4) (90 . 5) (90 . 6) (90 . 7) (90 . 4) (90 . 0) (90 . 7) (90 . 6) (90 . 1) (90 . 4) (90 . 2) (90 . 5) (90 . 4) (90 . 3) (90 . 4) (90 . 3) (90 . 4) (90 . 7) (90 . 0) (90 . 4) (90 . 1) (90 . 6) (90 . 5) (90 . 2) (94 . 12) (90 . 0) (90 . 1) (90 . 1) (90 . 2) (90 . 2) (90 . 3) (90 . 3) (90 . 0) (90 . 4) (90 . 5) (90 . 5) (90 . 6) (90 . 6) (90 . 7) (90 . 7) (90 . 4) (90 . 0) (90 . 7) (90 . 6) (90 . 1) (90 . 2) (90 . 5) (90 . 4) (90 . 3) (95 . 12) )

Is it just an error BricsCAD or does BricsCAD needs some addional information in that list? Or does BricsCAD can't handle such a kind of mesh?

Comments

  • the last group (95 . 12) is the amount of crease edges (12), but no crease edges are following, and (72 . 0) defines "no crease edges" ...
    maybe just omit that last group (95 . 12) ?
    Anyway, I will check this interesting case - and try to fix, to improve compatibility :-)
    many greetings !

  • VirtualSteel
    edited September 2021

    Torsten, thanks - that's the solution. I never checked that value. According to your proposal I set it to zero (95 0) and it is running!! I am happy

    I coded it that way:
    ;;Crease data: (setq ent-list (cons (cons 95 (/ (length edges) 2)) ent-list))
    but did not know, what "crease edges" are for.

  • Many thanks for feedback ! Glad to hear about :-)

    Yes, using (95 0) is the proper way ... omitting the dxf 95 group will still result in a crash (where AutoCAD also succeeds).

    Nevertheless, I tried on local build, and could reproduce ... where AutoCAD properly created the Mesh entity
    (same problem with DXF files, btw.)
    Locally fixed in our underlying Teigha libraries, should be "officially fixed" with V22 then;
    "incomplete" DXF data are somewhat valid, so the Teigha system needs to be tolerant here, as AutoCAD is.

    many greetings !

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!