Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Create Drawing" not working for some views. #4029

Open
Owuraqu opened this issue Nov 20, 2023 · 2 comments
Open

"Create Drawing" not working for some views. #4029

Owuraqu opened this issue Nov 20, 2023 · 2 comments
Assignees

Comments

@Owuraqu
Copy link

Owuraqu commented Nov 20, 2023

Good morning. When I try to create some elevation drawings I get “An unkwown error occurred” report. Only one elevation (West Elevation) has been successful. I had same problem with creating some of the sections but when I deleted and created the section views again it worked but for the other three elevations it doesn’t work even after deleting and recreating them except the West Elevation. I even uninstalled and updated BB to yesterday’s version but same error surfaces. Find
ifc file.

image

@Moult
Copy link
Contributor

Moult commented Nov 24, 2023

@aothms what's the easiest way to help you debug these types of issues? I've isolated it to this file (containing only the terrain and a wall - if you remove one or the other, it works, but when both are together, they fail) and test script:

wallterrain.ifc.txt

import ifcopenshell
import ifcopenshell.geom
import multiprocessing

ifc = ifcopenshell.open("/home/dion/tmp/svgcreationbug/wallterrain.ifc")

svg_settings = ifcopenshell.geom.settings(
    DISABLE_TRIANGULATION=True, STRICT_TOLERANCE=True, INCLUDE_CURVES=True
)
svg_buffer = ifcopenshell.geom.serializers.buffer()
serialiser = ifcopenshell.geom.serializers.svg(svg_buffer, svg_settings)
serialiser.setFile(ifc)
serialiser.setWithoutStoreys(True)
serialiser.setPolygonal(True)
serialiser.setUseHlrPoly(True)
# Objects with more than these edges are rendered as wireframe instead of HLR for optimisation
serialiser.setProfileThreshold(10000)
serialiser.setUseNamespace(True)
serialiser.setAlwaysProject(True)
serialiser.setAutoElevation(False)
serialiser.setAutoSection(False)
serialiser.setPrintSpaceNames(False)
serialiser.setPrintSpaceAreas(False)
serialiser.setDrawDoorArcs(False)
serialiser.setNoCSS(True)
serialiser.setElevationRefGuid('2vdjFQTKTB98l6RJP4va8z')
serialiser.setScale(0.01)
serialiser.setSubtractionSettings(ifcopenshell.ifcopenshell_wrapper.ALWAYS)
serialiser.setUsePrefiltering(True)
serialiser.setUnifyInputs(True)
serialiser.setSegmentProjection(True)

geom_settings = ifcopenshell.geom.settings(
    DISABLE_TRIANGULATION=True, STRICT_TOLERANCE=True, INCLUDE_CURVES=True
)
geom_settings.set_context_ids([8275])
it = ifcopenshell.geom.iterator(
    geom_settings, 
    ifc, 
    multiprocessing.cpu_count(), 
    # 8253 (Terrain), 8309 (Wall), 8339 (Camera)
    include={ifc.by_id(i) for i in [8253, 8309, 8339]}
)

def yield_from_iterator(it):
    if it.initialize():
        while True:
            yield it.get()
            if not it.next():
                break

for elem in yield_from_iterator(it):
    serialiser.write(elem)
serialiser.finalize()
print(svg_buffer.get_value())

@Owuraqu
Copy link
Author

Owuraqu commented Nov 25, 2023

Okay I will try and delete the terrain from the model as @Moult and @aothms tries to get this resolved. Thank you @Moult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants