Giter VIP home page Giter VIP logo

Comments (3)

dassaf4 avatar dassaf4 commented on September 10, 2024

Details:

  • When the input CurveVector is a closed region, we already have ClipPlaneSet::ClipPlanarRegion. Given a region input, it returns a single region output.
  • When the input CurveVector is open, the result can be multiple (disjoint) CurveVectors. What is the preferred return type for this?
    • I've seen disjoint curves packaged into one CurveVectorPtr that has BOUNDARY_TYPE_None, however the doc for this enum type discourages this, preferring instead bvector<CurveVectorPtr>. This kind of rules out one method for both open and closed inputs, unless we want to return the single closed result as the only entry in the bvector, which I guess could work. But at the very least, it means a new method, because we cannot change the signature of the existing one.
    • The problem with returning a CurveVectorPtr per clipped open curve piece is that there is no record of the provenance of that piece in the context of the original open curve, e.g., the fractional parameter span of the clipped piece in the original curve's [0,1] parameter space. This is why I like CurveLocationDetailPair, an array of which is returned by ClipPlaneSet::AppendCrossings---each entry in this array describes a pair of locations on the input curve representing the start and end of a clipped piece. If you have such an array, you can easily build up a bvector of the clipped pieces by calling CurveVector::CloneBetweenDirectedFractions(detail0, detail1) on each CurveLocationDetailPair.
  • When the input CurveVector is open, we also have the option to ignore certain ClipPlanes in the clipper. I believe there are a couple of flags on the clipper (or clip plane) that determine this. There should be methods on ClipPlane that return visibility flags or some such. At the least, we should honor plane visibility and skip those that are hidden/invisible. We could also provide an input flag to ignore them and clip to all planes. Again, look for precedent in the API.
  • So I propose two new methods:
    • Main method: void ClipCurveVector(CurveVectorCR curve, bvector<CurveVectorPtr>& clippedCurves) const calls the existing ClipPlanarRegion method if CurveVector::IsAnyRegionType() is true, otherwise the new open method (below).
    • Open method: bool ClipOpenPath(CurveVectorCR openCurve, bvector<CurveVectorPtr>* pClippedCurves = nullptr, bvector<CurveLocationDetailPair>* pClippedDetails = nullptr) const. Both optional returned arrays should be sorted by the original open path's global parameterization, or if boundaryType None, by the ordering of its primitives. Return false if openCurve.IsAnyRegionType() returns true; otherwise, calls AppendCrossings + CloneBetweenDirectedFractions as described above. Note: this method should handle input of non-region boundaryType, i.e., Open or None.

from imodel-native.

saeeedtorabi avatar saeeedtorabi commented on September 10, 2024

In imodel-native, there's a variant of CloneBetweenDirectedFractions which takes curve details. I should add that when I do the port to MS.

from imodel-native.

saeeedtorabi avatar saeeedtorabi commented on September 10, 2024

imodel-native PR
#353 (merged)

imodel02 PR
https://dev.azure.com/bentleycs/iModelTechnologies/_git/imodel02/pullrequest/351921 (merged)
https://dev.azure.com/bentleycs/iModelTechnologies/_git/imodel02/pullrequest/352640 (merged)

power-platform PR and PBI
https://dev.azure.com/bentleycs/PowerPlatform/_workitems/edit/1238279
https://dev.azure.com/bentleycs/PowerPlatform/_git/PPBase/pullrequest/351920 (merged)

iTwin PR
iTwin/itwinjs-core#5804

from imodel-native.

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.