Repository navigation
Description
Describe the bug 📝
A BCF clipping plane never reaches the scene through Viewpoints.create(data) or BCFTopics.load, and when one is made through set(), the opposite half of the model is cut off.
A BCF 3.0 file with one clipping plane (IFC Z = 7.5 m, direction up: the part above is cut off), imported. Left: the building cut through its windows. Right: BCFTopics.load + go(), no clipping plane.
The same plane given to set() on a viewpoint that has a world. Left: the part above the plane is cut off. Right: the part below.
- Dropped:
set()creates clipping planes only when the viewpoint has a world.Viewpoints.create(data)runsset()in the constructor and gives the world only after it, andBCFTopics.loadcreates its viewpoints withnew Viewpoint(components, data)and never gives them a world, even whenViewpoints.worldis set. (Viewpoint.go() does nothing, silently, when the viewpoint has no world #842 describes the missing world forgo(); the error fix(viewpoints): throw a clear error when go() has no world #843 adds would then fire for every imported viewpoint.) - Inverted: the
Viewpointdocs say the direction "points in the invisible direction meaning the half-space that is clipped", as BCF does.set()passes it toClipper.createFromNormalAndCoplanarPointas the normal, and a Clipper plane keeps the half its normal points to (the Clipper's owncreate()negates the face normal for that).toJSON()writes the normal back as the direction, so a round trip inside That Open matches, but every plane exchanged with another BCF tool clips the opposite half. - Unread:
loadreadsLocation.x/Direction.x, but BCF-XML has<Location><X>…, andBCFTopics.xmlParserkeeps the tag names, so every coordinate isundefined. - Title (same method):
set(data)runsthis.title = data.title, so aset()without a title clears it, although the docs say the properties not given remain unchanged.
Writing the planes to .bcfv on export is listed in #825.
Expected: create(data) and load give the viewpoint its world before set() (or set() makes the planes once a world is given); the plane's normal is the opposite of the BCF direction (and toJSON() writes the opposite of the normal); load reads Location.X / .Y / .Z and the same for Direction; set() keeps the title when data.title is undefined.
Where in the code
- The world check in
set(): viewpoint.ts#L311;Viewpoints.create(data): Viewpoints/index.ts#L49-L51;BCFTopics.load: BCFTopics/index.ts#L715 - The docs: viewpoint.ts#L34; the normal: #L325-L329;
toJSON(): #L724; the Clipper'screate(): Clipper/index.ts#L482 - Reading the plane in
load: BCFTopics/index.ts#L704-L709 - The title: viewpoint.ts#L242
Reproduction ▶️
https://github.com/BiroBotond0/thatopen-bcf-bug-reproduction/tree/main/issue-7
Steps to reproduce 🔢
- In the repro:
npm install,npm run dev, openissue-7/example.html. Both worlds load buildingSMART'sArchitectural.ifcand look through its "Perspective camera" test case. buildingSMART has no BCF 2.1 or 3.0 test case with a clipping plane, so the example builds a BCF 3.0 file with one (Download the .bcfzip saves it). - Import the file (BCFTopics.load) imports it on the right with
go()(first picture). - set() on a viewpoint with a world gives the same plane to
set()(second picture). Its location is moved by the base coordination matrix by hand, see Viewpoint: clipping planes and the position setter ignore the base coordination matrix #862 , so only the direction differs. - The panel's Results (the imported viewpoint, what
loadreads of the plane, and the title after aset()without one):
BUG imported viewpoint has a world: got false, expected true
BUG imported viewpoint's clipping planes: got 0, expected 1
BUG Location.x, what load() reads: got undefined, expected 6
BUG title after set() without a title: got null, expected "Level 2"
System Info 💻
System:
OS: Windows 11 10.0.26200
CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
Memory: 33.34 GB / 63.76 GB
Binaries:
Node: 22.22.1 - C:\nvm4w\nodejs\node.EXE
npm: 11.12.0 - C:\nvm4w\nodejs\npm.CMD
Browsers:
Chrome: 156.0.8078.48
Edge: Chromium (152.0.4191.53)
npmPackages:
@thatopen/components: 3.6.0 => 3.6.0
@thatopen/components-front: 3.6.0 => 3.6.0
@thatopen/fragments: 3.6.0 => 3.6.0
@thatopen/ui: 3.4.17 => 3.4.17
camera-controls: 3.1.2 => 3.1.2
three: 0.184.0 => 0.184.0
web-ifc: 0.0.77 => 0.0.77Used Package Manager 📦
npm
Error Trace/Logs 📃
No response
Validations ✅
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
- Check that this is a concrete bug. For Q&A join our Community.
- The provided reproduction is a minimal reproducible example of the bug.
Activity