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

Add_profile_representation and clippings #3547

Closed
maxfb87 opened this issue Aug 5, 2023 · 2 comments
Closed

Add_profile_representation and clippings #3547

maxfb87 opened this issue Aug 5, 2023 · 2 comments

Comments

@maxfb87
Copy link
Contributor

maxfb87 commented Aug 5, 2023

I think that there is a problem with "add_profile_representation" api and clippings.
In order to recreate the problem, try to create a new project with demo library and add a new column on 0,0,0 with the length 5m
After that, run this script

import blenderbim.tool as tool
import numpy as np
import ifcopenshell

model = tool.Ifc.get()
obj = C.active_object
entity = tool.Ifc.get_entity(obj)
representation = entity.Representation[2][1]
matrix = np.eye(4)
matrix = ifcopenshell.util.placement.rotation(45,"X") @ matrix
matrix[:,3][0:3] = (0, 0, 3)
matrix = matrix.tolist()
ifcopenshell.api.run("geometry.add_boolean", model, representation = representation, type = "IfcHalfSpaceSolid", matrix = matrix)

Basically i want to apply a simple clipping plane on the column.
After that, try to regen the object: i get the same error as reported here

I think that the problem is in the "add_profile_representation" api.
I have created a possible solution and, if you want, i'll do a PR but, before that, i wanted to be sure that this is actually a bug...
Thanks,
Massimo

@Moult
Copy link
Contributor

Moult commented Aug 5, 2023

Yes, it's a bug :) PR very welcome!

maxfb87 added a commit to maxfb87/IfcOpenShell that referenced this issue Aug 5, 2023
@maxfb87 maxfb87 mentioned this issue Aug 5, 2023
@Moult Moult closed this as completed in e433471 Aug 8, 2023
@Moult
Copy link
Contributor

Moult commented Aug 8, 2023

I ended up doing this slightly simpler and using the ifcopenshell.util.element.copy which preserves the operation type instead of hardcoding DIFFERENCE and also fixing the same bug in the wall representation function.

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

No branches or pull requests

2 participants