Example: /Tools/Clipper/Clipper Offset Test

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Tools/Clipper/Clipper Offset Test


Required plugins for this example: MBS Tools Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Tools/Clipper/Clipper Offset Test

This example is the version from Fri, 4th Jan 2018.

Project "Clipper Offset Test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
EventHandler Sub Open() dim p as new Picture(Width, Height, 32) dim subj as new ClipperPathMBS dim solution as ClipperPathsMBS subj.Append new ClipperPointMBS(348,257) subj.Append new ClipperPointMBS(364,148) subj.Append new ClipperPointMBS(362,148) subj.Append new ClipperPointMBS(326,241) subj.Append new ClipperPointMBS(295,219) subj.Append new ClipperPointMBS(258,88) subj.Append new ClipperPointMBS(440,129) subj.Append new ClipperPointMBS(370,196) subj.Append new ClipperPointMBS(372,275) const EndTypeClosedPolygon = 0 const JoinTypeRound = 1 dim co as new ClipperOffsetMBS co.AddPath(subj, JoinTypeRound, EndTypeClosedPolygon) co.Execute(solution, -7.0) DrawPolygon(p.graphics, subj, &c888888) dim solution0 as ClipperPathMBS = solution.Value(0) dim solution1 as ClipperPathMBS = solution.Value(1) 'dim values0() as ClipperPointMBS = solution0.Values 'dim values1() as ClipperPointMBS = solution1.Values //draw solution ... DrawPolygon(p.graphics, solution0, &c4000FF) DrawPolygon(p.graphics, solution1, &cFF0099) Backdrop = p End EventHandler
Sub DrawPolygon(g as graphics, p as ClipperPathMBS, c as color) dim coordinates(0) as integer dim points() as ClipperPointMBS = p.Values for each point as ClipperPointMBS in points coordinates.Append point.x coordinates.Append point.y next g.ForeColor = c g.FillPolygon coordinates End Sub
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

The items on this page are in the following plugins: MBS Tools Plugin.


💬 Ask a question or report a problem