filling of convex hull of model points
-
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.
-
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 } }
-