Giter Site home page Giter Site logo

gh-sharp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gh-sharp's Issues

Intersect_Mathematical.ghx BrepPlaneIntersection Issue

I found that the BrepPlaneIntersection part may not generate the same result as original Grasshopper. Original Grasshopper generate one line. And gh-sharp-master may generate two or more. I found we can join curves after BrepPlane to fix this problem.
The Commond Code BrepPlaneIntersection of in gh-sharp-master/src/Intersect_Mathematical.ghx is as follow:

private void RunScript(Brep B, Plane P, ref object C, ref object POut)
  {
    //Component written by @bava-kumaravel
    //Solve intersection between a brep B and an infinite plane P and
    //return list of section curves C and list of intersection points POut

    //Define arrays to hold the section curves and intersection points
    Curve[] curves = new Curve[0];
    Point3d[] points = new Point3d[0];

    //Define tolerance as the Model Space Absolute Tolerance
    double tol = doc.ModelAbsoluteTolerance;

    //Perform intersection
    bool success = Rhino.Geometry.Intersect.Intersection.BrepPlane(
      B, P, tol, out curves, out points);

    //Outputs
    if(success){
      C = curves;
      POut = points;
    }

My Code is as follow

private void RunScript(Brep B, Plane P, ref object C, ref object POut)
  {
    //Component written by @bava-kumaravel
    //Solve intersection between a brep B and an infinite plane P and
    //return list of section curves C and list of intersection points POut

    //Define arrays to hold the section curves and intersection points
    Curve[] curves = new Curve[0];
    Point3d[] points = new Point3d[0];

    //Define tolerance as the Model Space Absolute Tolerance
    double tol = doc.ModelAbsoluteTolerance;

    //Perform intersection
    bool success = Rhino.Geometry.Intersect.Intersection.BrepPlane(
      B, P, tol, out curves, out points);

    // Join Curves
    if (success && curves.Length > 1) 
    {
          curves = Curve.JoinCurves(curves, tol);
     }

    //Outputs
    if(success){
      C = curves;
      POut = points;
    }

In addition, I would like to express my sincere gratitude to Professor Luis for their assistance in my programming learning journey. Your courses have been extremely beneficial to me.

IssueBrepPlaneIntersect.zip

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.