GithubHelp home page GithubHelp logo

Comments (3)

orbingol avatar orbingol commented on May 26, 2024

I don't have a valid ACIS license anymore, so I cannot test it. ZeroDivisionError may happen, because the algorithms are using the user input directly. There is a frange implementation, but I doubt that's the problem. There were several other problems like that and converting values like -59.99999999999998579 to -60 worked fine at that point. You could try that.

I was planning to implement a more precise floating point control to eliminate such issues, but never had time to do it without adding any additional dependencies.

from nurbs-python.

chenboshuo avatar chenboshuo commented on May 26, 2024

I don't have a valid ACIS license anymore, so I cannot test it. ZeroDivisionError may happen, because the algorithms are using the user input directly. There is a frange implementation, but I doubt that's the problem. There were several other problems like that and converting values like -59.99999999999998579 to -60 worked fine at that point. You could try that.

I was planning to implement a more precise floating point control to eliminate such issues, but never had time to do it without adding any additional dependencies.

I changed this snippets to

from geomdl import BSpline

# Create a BSpline surface instance (Bezier surface)
surf = BSpline.Surface()

surf.degree_u=2
surf.degree_v=2
surf.ctrlpts_size_u=5
surf.ctrlpts_size_v=9
surf.ctrlpts=[
                (52.5, 60, 0),
                (52.5, 60, 60),
                (52.5, 0, 60),
                (52.5, -60, 60.0),
                (52.5, -60, 0),
                (52.5, -60.0, -60),
                (52.5, 0, -60),
                (52.5, 60, -60.0),
                (52.5, 60, 0),
                (17.5, 60, 0),
                (17.5, 60, 60),
                (17.5, 0, 60),
                (17.5, -60, 60),
                (17.5, -60, 0),
                (17.5, -60, -60),
                (17.5, 0, -60),
                (17.5, 60, -60),
                (17.5, 60, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (17.5, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
                (0, 0, 0),
]
surf.weights=[
1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 0.5, 0.707107, 0.5, 0.707107, 0.5, 0.707107, 0.5, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0.707107, 1, 0, 52.5, 60, 0, 52.5, 60, 60, 52.5, 0, 60, 52.5, -60, 60, 52.5, -60, 0, 52.5, -60, ]
surf.knotvector_u=[0, 0, 0, 1, 1, 1, 1, 1, ]
surf.knotvector_v=[0, 0, 0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1, 1, 1, ]
# Evaluate surface points
surf.evaluate()

# Plot the control points grid and the evaluated surface
surf.vis = VisMPL.VisSurface(vis_config)

I am still encountering the same error.

from nurbs-python.

orbingol avatar orbingol commented on May 26, 2024

Could you also update the weights like you did for the control points? I'd try converting 0.707107 to 0.70711 and remove one significant if it doesn't work.

from nurbs-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.