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

Error: compas.set_precision #1419

Open
nizartaha opened this issue Jan 10, 2025 · 2 comments
Open

Error: compas.set_precision #1419

nizartaha opened this issue Jan 10, 2025 · 2 comments

Comments

@nizartaha
Copy link
Contributor

compas.set_precision(0.001)
AttributeError: module 'compas' has no attribute 'set_precision'

https://compas.dev/compas/1.5.0/api/generated/compas.set_precision.html

I wanted to round the Frame values to 6 digits , how is it possible when using compas.json_dump ?

 "data": {
    "point": [
        665.6414239488341,
        -218.07475329238576,
        652.9999999999999
    ],
    "xaxis": [
        0.25779917216805537,
        0.9661985235082206,
        -6.938893903907227e-18
    ],
    "yaxis": [
        0.9661985235082206,
        -0.25779917216805537,
        -1.224646799147353e-16
    ]
},
"dtype": "compas.geometry/Frame",
"guid": "77685a15-8823-4110-8eaf-1aa445e233b8"
@gonzalocasas
Copy link
Member

@nizartaha Hi Nizar, are you using compas 1.5? On newer COMPAS releases (2.x+), this was moved to the tolerance module. However, I think the storage to json will not round things, it will preserve original precision, but the precision will be used for comparisons and other geometric operations. Changing it in the json would be a destructive operation, if you really want to round the data, you will need to do something more explicitly. (@tomvanmele correct me if I'm wrong here, please)

@nizartaha
Copy link
Contributor Author

Hi @gonzalocasas good point. i am using 2.4.2 (my fault, the docs was open for 1.5 :/)

I see , if it has to be done explicitly then would it be after the data is exported? what do you suggest?

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

No branches or pull requests

2 participants