Code Monkey home page Code Monkey logo

Comments (3)

mhugo avatar mhugo commented on July 17, 2024

@vmora what's the state of this issue ?

from sfcgal.

vmora avatar vmora commented on July 17, 2024

not tested yet

what I had in mind is:

st_intersection(st_extrude('POLGON((0 0,1 0,1 1,0 1,0 0))'::geometry, 0, 0, 1), st_extrude('POLGON((.7 0,1.7 0,1.7 1,.7 1,1.5 .5, 0 0))'::geometry, 0, 0, 1));

from sfcgal.

danielcu888 avatar danielcu888 commented on July 17, 2024

@mhugo, @vmora this is duplicated by issue #200 which I created.

I adapted your example in to a unit test here (corrected a couple of typos and the non-closed Polygon):

BOOST_AUTO_TEST_CASE( testIssue62 )
{
  std::unique_ptr< Geometry > poly1 = io::readWkt( "POLYGON((0 0,1 0,1 1,0 1,0 0))" );
  std::unique_ptr< Geometry > solid1 = algorithm::extrude( *poly1, 0, 0, 1 );

  std::unique_ptr< Geometry > poly2 = io::readWkt( "POLYGON((0.7 0,1.7 0,1.7 1,0.7 1,1.5 0.5,0.7 0))" );
  std::unique_ptr< Geometry > solid2 = algorithm::extrude( *poly2, 0, 0, 1 );

  std::unique_ptr< Geometry > inx = algorithm::intersection3D( *solid1, *solid2 );

  std::cout << "inx: " << inx->asText() << std::endl;
}

with the Solid result:

SOLID((((1/1 3/16 0/1,1/1 0/1 0/1,7/10 0/1 0/1,1/1 3/16 0/1)),((7/10 0/1 0/1,7/10 0/1 3/10,1/1 3/16 0/1,7/10 0/1 0/1)),((1/1 0/1 0/1,7/10 0/1 3/10,7/10 0/1 0/1,1/1 0/1 0/1)),((1/1 3/16 0/1,1/1 3/16 5/8,1/1 0/1 0/1,1/1 3/16 0/1)),((7/10 0/1 3/10,1/1 3/16 5/8,1/1 3/16 0/1,7/10 0/1 3/10)),((1/1 0/1 0/1,1/1 0/1 7/10,7/10 0/1 3/10,1/1 0/1 0/1)),((1/1 3/16 5/8,1/1 0/1 7/10,1/1 0/1 0/1,1/1 3/16 5/8)),((7/10 0/1 3/10,7/10 0/1 1/1,1/1 3/16 5/8,7/10 0/1 3/10)),((1/1 0/1 7/10,7/10 0/1 1/1,7/10 0/1 3/10,1/1 0/1 7/10)),((1/1 3/16 5/8,1/1 3/16 13/16,1/1 0/1 7/10,1/1 3/16 5/8)),((7/10 0/1 1/1,1/1 3/16 13/16,1/1 3/16 5/8,7/10 0/1 1/1)),((1/1 0/1 7/10,1/1 0/1 1/1,7/10 0/1 1/1,1/1 0/1 7/10)),((1/1 3/16 13/16,1/1 0/1 1/1,1/1 0/1 7/10,1/1 3/16 13/16)),((7/10 0/1 1/1,23/26 3/26 1/1,1/1 3/16 13/16,7/10 0/1 1/1)),((1/1 0/1 1/1,23/26 3/26 1/1,7/10 0/1 1/1,1/1 0/1 1/1)),((1/1 3/16 13/16,1/1 3/16 1/1,1/1 0/1 1/1,1/1 3/16 13/16)),((23/26 3/26 1/1,1/1 3/16 1/1,1/1 3/16 13/16,23/26 3/26 1/1)),((1/1 0/1 1/1,1/1 3/16 1/1,23/26 3/26 1/1,1/1 0/1 1/1)),((1/1 1/1 1/1,7/10 1/1 7/10,7/10 1/1 1/1,1/1 1/1 1/1)),((7/10 1/1 1/1,1/1 13/16 1/1,1/1 1/1 1/1,7/10 1/1 1/1)),((7/10 1/1 7/10,1/1 13/16 1/1,7/10 1/1 1/1,7/10 1/1 7/10)),((1/1 1/1 1/1,1/1 1/1 3/10,7/10 1/1 7/10,1/1 1/1 1/1)),((1/1 13/16 1/1,1/1 13/16 3/8,1/1 1/1 1/1,1/1 13/16 1/1)),((7/10 1/1 7/10,1/1 13/16 3/8,1/1 13/16 1/1,7/10 1/1 7/10)),((1/1 1/1 3/10,7/10 1/1 0/1,7/10 1/1 7/10,1/1 1/1 3/10)),((1/1 1/1 1/1,1/1 13/16 3/8,1/1 1/1 3/10,1/1 1/1 1/1)),((7/10 1/1 7/10,7/10 1/1 0/1,1/1 13/16 3/8,7/10 1/1 7/10)),((1/1 1/1 3/10,1/1 1/1 0/1,7/10 1/1 0/1,1/1 1/1 3/10)),((1/1 13/16 3/8,1/1 13/16 3/16,1/1 1/1 3/10,1/1 13/16 3/8)),((7/10 1/1 0/1,1/1 13/16 3/16,1/1 13/16 3/8,7/10 1/1 0/1)),((1/1 1/1 0/1,23/26 23/26 0/1,7/10 1/1 0/1,1/1 1/1 0/1)),((1/1 1/1 3/10,1/1 13/16 3/16,1/1 1/1 0/1,1/1 1/1 3/10)),((7/10 1/1 0/1,23/26 23/26 0/1,1/1 13/16 3/16,7/10 1/1 0/1)),((1/1 1/1 0/1,1/1 13/16 0/1,23/26 23/26 0/1,1/1 1/1 0/1)),((1/1 13/16 3/16,1/1 13/16 0/1,1/1 1/1 0/1,1/1 13/16 3/16)),((23/26 23/26 0/1,1/1 13/16 0/1,1/1 13/16 3/16,23/26 23/26 0/1))))

whereas it should be the two part MultiSolid:

MULTISOLID(((((1/1 3/16 0/1,1/1 0/1 0/1,7/10 0/1 0/1,1/1 3/16 0/1)),((7/10 0/1 0/1,7/10 0/1 3/10,1/1 3/16 0/1,7/10 0/1 0/1)),((1/1 0/1 0/1,7/10 0/1 3/10,7/10 0/1 0/1,1/1 0/1 0/1)),((1/1 3/16 0/1,1/1 3/16 5/8,1/1 0/1 0/1,1/1 3/16 0/1)),((7/10 0/1 3/10,1/1 3/16 5/8,1/1 3/16 0/1,7/10 0/1 3/10)),((1/1 0/1 0/1,1/1 0/1 7/10,7/10 0/1 3/10,1/1 0/1 0/1)),((1/1 3/16 5/8,1/1 0/1 7/10,1/1 0/1 0/1,1/1 3/16 5/8)),((7/10 0/1 3/10,7/10 0/1 1/1,1/1 3/16 5/8,7/10 0/1 3/10)),((1/1 0/1 7/10,7/10 0/1 1/1,7/10 0/1 3/10,1/1 0/1 7/10)),((1/1 3/16 5/8,1/1 3/16 13/16,1/1 0/1 7/10,1/1 3/16 5/8)),((7/10 0/1 1/1,1/1 3/16 13/16,1/1 3/16 5/8,7/10 0/1 1/1)),((1/1 0/1 7/10,1/1 0/1 1/1,7/10 0/1 1/1,1/1 0/1 7/10)),((1/1 3/16 13/16,1/1 0/1 1/1,1/1 0/1 7/10,1/1 3/16 13/16)),((7/10 0/1 1/1,23/26 3/26 1/1,1/1 3/16 13/16,7/10 0/1 1/1)),((1/1 0/1 1/1,23/26 3/26 1/1,7/10 0/1 1/1,1/1 0/1 1/1)),((1/1 3/16 13/16,1/1 3/16 1/1,1/1 0/1 1/1,1/1 3/16 13/16)),((23/26 3/26 1/1,1/1 3/16 1/1,1/1 3/16 13/16,23/26 3/26 1/1)),((1/1 0/1 1/1,1/1 3/16 1/1,23/26 3/26 1/1,1/1 0/1 1/1)),((1/1 1/1 1/1,7/10 1/1 7/10,7/10 1/1 1/1,1/1 1/1 1/1)),((7/10 1/1 1/1,1/1 13/16 1/1,1/1 1/1 1/1,7/10 1/1 1/1)),((7/10 1/1 7/10,1/1 13/16 1/1,7/10 1/1 1/1,7/10 1/1 7/10)),((1/1 1/1 1/1,1/1 1/1 3/10,7/10 1/1 7/10,1/1 1/1 1/1)),((1/1 13/16 1/1,1/1 13/16 3/8,1/1 1/1 1/1,1/1 13/16 1/1)),((7/10 1/1 7/10,1/1 13/16 3/8,1/1 13/16 1/1,7/10 1/1 7/10)),((1/1 1/1 3/10,7/10 1/1 0/1,7/10 1/1 7/10,1/1 1/1 3/10)),((1/1 1/1 1/1,1/1 13/16 3/8,1/1 1/1 3/10,1/1 1/1 1/1)),((7/10 1/1 7/10,7/10 1/1 0/1,1/1 13/16 3/8,7/10 1/1 7/10)),((1/1 1/1 3/10,1/1 1/1 0/1,7/10 1/1 0/1,1/1 1/1 3/10)),((1/1 13/16 3/8,1/1 13/16 3/16,1/1 1/1 3/10,1/1 13/16 3/8)),((7/10 1/1 0/1,1/1 13/16 3/16,1/1 13/16 3/8,7/10 1/1 0/1)),((1/1 1/1 0/1,23/26 23/26 0/1,7/10 1/1 0/1,1/1 1/1 0/1)),((1/1 1/1 3/10,1/1 13/16 3/16,1/1 1/1 0/1,1/1 1/1 3/10)),((7/10 1/1 0/1,23/26 23/26 0/1,1/1 13/16 3/16,7/10 1/1 0/1)),((1/1 1/1 0/1,1/1 13/16 0/1,23/26 23/26 0/1,1/1 1/1 0/1)),((1/1 13/16 3/16,1/1 13/16 0/1,1/1 1/1 0/1,1/1 13/16 3/16)),((23/26 23/26 0/1,1/1 13/16 0/1,1/1 13/16 3/16,23/26 23/26 0/1)))))

the cause being the two disjoint 3-cells resulting from the polyline intersections between the two boundaries being collectively processed by the Volume_import_modifier resulting in the first generated output Polyhedron containing two disjoint components.

from sfcgal.

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.