Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. filling of convex hull of model points
Forum Updated to NodeBB v4.3 + New Features

filling of convex hull of model points

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 181 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    squareroot13
    wrote on last edited by
    #1

    How to create a filling of custom colour for convex hull with points from model ?
    I know how to draw convex hull:
    example code is below:

    Repeater {
              model: (page_algo.hmodel.count > 1)?page_algo.hmodel.count - 1:0
              Shape {
                  anchors.fill: parent
                  visible: cvxReady
                  ShapePath {
                     id: shapep
                     strokeWidth: 4
                     strokeColor: 'red'
                     fillColor: "white"
                     //capStyle: ShapePath.RoundCap
                     //joinStyle: ShapePath.RoundJoin
                     //fillRule: ShapePath.WindingFill
                     startX: page_algo.cvxReady? page_algo.hmodel.get(index).x: 0;
                     startY: page_algo.cvxReady? page_algo.hmodel.get(index).y: 0;
                      PathLine {
                          property int mcnt: page_algo.hmodel.count
                          x: page_algo.cvxReady? page_algo.hmodel.get((index + 1)%mcnt).x: 10
                          y: page_algo.cvxReady? page_algo.hmodel.get((index + 1)%mcnt).y: 0;
                      }
                  }
              }
          }
    

    But i can't to fill my shape.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      squareroot13
      wrote on last edited by
      #2

      Probles is solved.

      Shape {
                anchors.fill: parent
                visible: cvxReady
                ShapePath {
                    id: myPath
                    fillColor: "white"
                    strokeColor: "red"
                    capStyle: ShapePath.RoundCap
                    joinStyle: ShapePath.RoundJoin
                    strokeWidth: 3
                    strokeStyle: ShapePath.SolidLine
                    startX: page_algo.cvxReady? page_algo.hmodel.get(0).x: 0;
                    startY: page_algo.cvxReady? page_algo.hmodel.get(0).y: 0;
                }
            }
            Instantiator {
                model: page_algo.hmodel
                onObjectAdded: myPath.pathElements.push(object)
                PathLine {
                    x: model.mcoord.x
                    y: model.mcoord.y
                }
            }
      
      1 Reply Last reply
      0
      • S squareroot13 has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved