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

IDSFacet - Bounds parameter comparrison error #536

Open
5 tasks done
brettburling opened this issue Nov 26, 2024 · 2 comments
Open
5 tasks done

IDSFacet - Bounds parameter comparrison error #536

brettburling opened this issue Nov 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@brettburling
Copy link

brettburling commented Nov 26, 2024

Describe the bug 📝

I would like to define a property facet to check the minimum length of walls
I expect to be able to do this using a facet parameter of "bounds" type and specifying a min value
The check always fails

I belive the evalRequirement method in the IDSFacet class has the comparisons reversed:

Current code is:

minPass = minInclusive ? value <= min : value < min;`

I belive it should be:

minPass = minInclusive ? value >= min : value > min;`

I created the property facet with this code:

//create property facet
const propertyFacet = new OBC.IDSProperty(
    ifcStore.components,
    { type: 'enumeration', parameter: ['Dimensions'] },
    { type: 'simple', parameter: 'Length' }
  )

//set value requirement
 propertyFacet.value = {
    type: 'bounds',
    parameter: {
      min: 1000,
      minInclusive: false
    }
  }

Here is the console log of the result from the IDS specification test method:
2024-11-26_15-52-51

You can see:

  1. the check fails
  2. the current value (10000)
  3. the min required value (1000)

Reproduction ▶️

No response

Steps to reproduce 🔢

No response

System Info 💻

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
    Memory: 7.95 GB / 31.73 GB
  Binaries:
    Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 10.2.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 131.0.6778.86
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Used Package Manager 📦

yarn

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.
@brettburling brettburling added the bug Something isn't working label Nov 26, 2024
@brettburling brettburling changed the title IDS - Bounded parameter value error IDSFacet - Bounds parameter comparrison error Nov 26, 2024
@HoyosJuan HoyosJuan self-assigned this Nov 28, 2024
@brettburling
Copy link
Author

@HoyosJuan any updates on this? is it a legit bug or have i miss understood?

@HoyosJuan
Copy link
Member

Hey @brettburling! Hope you are fine and sorry about the delay 🙏

You're completely right. I already solved this in commit 2c7461f. The NPM version is 2.4.4.

Let me know if the problem is solved for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants