[PR] Arch Wall - Based on Sketch Issues

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

[PR] Arch Wall - Based on Sketch Issues

Postby paullee » Sat Sep 29, 2018 12:12 am

[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 1706 times
Screenshot from 2018-09-20 01-13-32.png
Screenshot from 2018-09-20 01-13-32.png (58.11 KiB) Viewed 1706 times
Attachments
Test_ ArchWall_ To_ IFC_ 3c_ Pure Sketch.fcstd
(11.42 KiB) Downloaded 44 times
Last edited by paullee on Sun Oct 27, 2019 3:54 am, edited 4 times in total.
paullee
Posts: 2979
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Postby paullee » Sat Sep 29, 2018 12:37 am

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 1702 times
Screenshot from 2018-09-20 01-38-29.png
Screenshot from 2018-09-20 01-38-29.png (122.03 KiB) Viewed 1702 times
cadgiru
Posts: 88
Joined: Thu Oct 27, 2016 9:53 am
Location: Norway
Contact:

Re: Arch Wall - Based on Sketch Issues

Postby cadgiru » 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.
paullee
Posts: 2979
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Postby paullee » Sat Sep 29, 2018 6:15 am

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
Posts: 2979
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Postby paullee » Wed Nov 14, 2018 5:50 pm

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 1621 times
Screenshot from 2018-11-15 01-32-49.png
Screenshot from 2018-11-15 01-32-49.png (443.54 KiB) Viewed 1621 times
Attachments
Wall Structure Stairs_ Win7_ FC-0.17.ifc
(365.58 KiB) Downloaded 58 times
paullee
Posts: 2979
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Postby paullee » Sat Nov 17, 2018 1:23 pm

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 1575 times
Attachments
Casita_FreeCAD_amarilla_08_comprimir_ IFC export and import.FCStd
(390.38 KiB) Downloaded 45 times
paullee
Posts: 2979
Joined: Wed May 04, 2016 3:58 pm

Re: Arch Wall - Based on Sketch Issues

Postby paullee » Tue Oct 22, 2019 6:24 pm

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
Posts: 2979
Joined: Wed May 04, 2016 3:58 pm

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

Postby paullee » Sun Oct 27, 2019 3:53 am

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 1032 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 1030 times
Attachments
Test_ ArchWall_ To_ IFC_ 3c_ Pure Sketch_ 2018.10.27.ifc
(3.15 KiB) Downloaded 26 times
ArchWall.py
(52.55 KiB) Downloaded 24 times
User avatar
yorik
Site Admin
Posts: 12145
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

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

Postby yorik » Mon Oct 28, 2019 5:02 pm

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.