[PR] Arch Wall - Based on Sketch Issues

This forum section is only for IFC-related issues
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

[PR] Arch Wall - Based on Sketch Issues

Post by paullee »

[EDIT] - See post on 27.10.2019

Extract from a post in original thread below :)
https://forum.freecadweb.org/viewtopic. ... 10#p257347

ArchWall based on Sketch with following Shape has problem:-
  1. A closed wire with multiple edges
  2. A random edge attach in above edge
  3. Resulted IFC shape is only a tiny bit as shown
  4. Without the 'random edge', the IFC seem fine - see next post
Original *.fcstd / *.ifc in original post/thread above, not further duplicating here
Test_ ArchWall_ To_ IFC_ 3c_ Pure Sketch.fcstd
(11.42 KiB) Downloaded 1 time
Test_ Arch Wall _3c_ Pure Sketch_ Linux_ IfcOpenShell_ Python_ 0.17.ifc
(6.42 KiB) Downloaded 1 time

EDIT:
Ifc Export / Viewer Setup
  1. OS - Fedora 27 64bit
  2. FC: Appimage - FreeCAD_0.17_13541.9948ee4.glibc2.17-x86_64 (Not really sure if it was this version then)
  3. IfcOpenShell Python - http://ifcopenshell.org/python.html
  4. IfcOpenShell Python - not compiled from latest source, just use 'pre-compiled' from above link (same 1 or 2 years not updated)
  5. Ifc Viewer - Ifc++, compiled from Bernd's repo
Screenshot from 2018-09-20 01-12-28.png
Screenshot from 2018-09-20 01-12-28.png (220.41 KiB) Viewed 4215 times
Screenshot from 2018-09-20 01-13-32.png
Screenshot from 2018-09-20 01-13-32.png (58.11 KiB) Viewed 4215 times
Attachments
Test_ ArchWall_ To_ IFC_ 3c_ Pure Sketch.fcstd
(11.42 KiB) Downloaded 97 times
Last edited by paullee on Sun Oct 27, 2019 3:54 am, edited 4 times in total.
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Post by paullee »

Extract from original post/thread below:
https://forum.freecadweb.org/viewtopic. ... 10#p257348

ArchWall based on Sketch with following Shape is OK:-
See screencaptures & files below


Original *.fcstd / *.ifc in above link not duplicated here again
Test_ ArchWall_ To_ IFC_ 3b_ Pure Sketch.fcstd
(8.1 KiB) Downloaded 2 times
Test_ Arch Wall _3b_ Pure Sketch_ Linux_ IfcOpenShell_ Python_ 0.17.ifc
(3.33 KiB) Downloaded 1 time
Screenshot from 2018-09-20 01-37-54.png
Screenshot from 2018-09-20 01-37-54.png (156.33 KiB) Viewed 4211 times
Screenshot from 2018-09-20 01-38-29.png
Screenshot from 2018-09-20 01-38-29.png (122.03 KiB) Viewed 4211 times
cadgiru
Posts: 91
Joined: Thu Oct 27, 2016 9:53 am
Location: Norway
Contact:

Re: Arch Wall - Based on Sketch Issues

Post by cadgiru »

Is this really an issue, believe one would generally classify walls by wall type.

In this example I would think it was natural that this was at least two walls.
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Post by paullee »

cadgiru wrote: Sat Sep 29, 2018 5:58 am Is this really an issue, believe one would generally classify walls by wall type.

In this example I would think it was natural that this was at least two walls.
You mean if the rectangular wall and the 'dialognal' wall are 2 Arch Wall object s, it would be ok?

Just FreeCad make it correctly; but when it export to IFC it is not correct.

So, not sure if it is IFC problem (it doesn't support this configuration of walls), FC IfcExport's problem, IfcOpenShell- Python (bwing version too old) or else?
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Post by paullee »

Hi, I try IFCexport (FC 0.17 in Win) Joyas's model and it looks good.
https://forum.freecadweb.org/viewtopic. ... 10#p268883

(Can't export Roof though )

Each Wall object is built on a sketch with simple edge, then hosted into a 'Master' Wall Object. (Each 'Slave Sketch' contains only simple edge referencing to a 'Master Sketch')

Seem then these Walls exports okay.

Downside is need more works and wall objects if the layout / sketch is 'complex'.
Screenshot from 2018-11-15 01-32-35.png
Screenshot from 2018-11-15 01-32-35.png (275.62 KiB) Viewed 4130 times
Screenshot from 2018-11-15 01-32-49.png
Screenshot from 2018-11-15 01-32-49.png (443.54 KiB) Viewed 4130 times
Attachments
Wall Structure Stairs_ Win7_ FC-0.17.ifc
(365.58 KiB) Downloaded 106 times
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Post by paullee »

Just notice the multi-layer wall is not exported all correctly - just look at the image closely.

In fact, I note the problem of multi-layer wall when I tried importing back the ifc file into FC.

Do not jog down all info but should be FC 0.17 release on Win 7.
Screenshot from 2018-11-17 21-22-20.png
Screenshot from 2018-11-17 21-22-20.png (265.01 KiB) Viewed 4084 times
Attachments
Casita_FreeCAD_amarilla_08_comprimir_ IFC export and import.FCStd
(390.38 KiB) Downloaded 91 times
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Post by paullee »

Hi, trying to dig into export.py to see why this is so...

Some observation:-
  1. getProfile() only use 1st wire if the shape contain only straight edge (polyline)
    w = Part.Wire(Part.__sortEdges__(p.Wires[0].Edges))
  2. createCurve() (for shape contain curve edge) has used Part.__sortEdges__() which only return 1st wire constructed from the wire.Edges - though there might be a numbers of wire
    edges = Part.__sortEdges__(wire.Edges)
  3. This seem to be the reason why multiple wall created from a sketch base only have portion of it created in the ifc file
Questions about ifc:-
I am not familiar with ifc standards at all, trying to check but it is huge for me to understand.
  1. Any limitation in ifc standards how many profile in a single ifcwall object?
  2. If above is yes, any other ifc object suitable for this case
Thanks for any idea

Code: Select all

def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tessellation=1,colors=None,preferences=None):
            ....
            if (not shapes) and hasattr(obj.Proxy,"getExtrusionData"):
                extdata = obj.Proxy.getExtrusionData(obj)
                if extdata:
                    ...
                            profile = getProfile(ifcfile,pi)

Code: Select all

def getProfile(ifcfile,p):
    ...
    else:
        if DraftGeomUtils.hasCurves(p):
            # extruded composite curve
            pol = createCurve(ifcfile,p)
        else:
            # extruded polyline
            w = Part.Wire(Part.__sortEdges__(p.Wires[0].Edges))
            ...

Code: Select all

def createCurve(ifcfile,wire):

    "creates an IfcCompositeCurve from a shape"

    segments = []
    pol = None
    last = None
    if wire.ShapeType == "edge":
        edges = [wire]
    else:
        edges = Part.__sortEdges__(wire.Edges)
...
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

[PR] Re: Arch Wall - Based on Sketch Issues

Post by paullee »

Turn out making ArchWall ( if there are multiple wires thus multiples faces in a sketch ) to add each face in the compound rather than fusing them.

This avoid the need to revise ifcExport.py, which check only the 1st face / wire only, to check if there are multiple faces in a shape.

Proposed ArchWall.py attached, see if anyone want to try.

The only problem now is, as the basefaces are not fused, solids may appears 'overlapped' in ifc - whilst in FC, the solids are fused and appear 'correctly' contiguous.
Screenshot from 2019-10-27 11-43-21.png
Screenshot from 2019-10-27 11-43-21.png (132.89 KiB) Viewed 3541 times
Appearance in FC (fused)
Screenshot from 2019-10-27 11-54-38.png
Screenshot from 2019-10-27 11-54-38.png (149.65 KiB) Viewed 3539 times
Attachments
Test_ ArchWall_ To_ IFC_ 3c_ Pure Sketch_ 2018.10.27.ifc
(3.15 KiB) Downloaded 71 times
ArchWall.py
(52.55 KiB) Downloaded 64 times
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [PR] Arch Wall - Based on Sketch Issues

Post by yorik »

I'm not sure we should always fuse. A wall could be made of different components that we would want to keep as distinct solids.
Post Reply