7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2024-11-22 11:35:00 +00:00
kicad/pcbnew/dialogs/dialog_outset_items.h
John Beard 8fdb6d6e88 Feature: Exact item offset tool
This is a little bit like the bounding hull tool, but the
output is "exact" and it only supports the most common
source items.

By 'exact', this means that rounded corners are real arc
segments rather than polygonal approximations. Obviously,
this is rather tricky in the general case, and especially
for any concave shape or anything with a bezier in it.

Envisioned main uses:

* Creating courtyard and silkscreen offsets in footprints
* Making slots around line or arcs.

The one thing that it does not currently do, but which it might
plausibly do without reimplementing Clipper is convex polygons,
which would bring trapezoidal pad outsets for free. But that
is a stretch goal, and bounding hull can be used.
2024-09-19 06:35:43 +01:00

60 lines
2.0 KiB
C++

/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma once
#include <pcb_base_frame.h>
#include <dialogs/dialog_outset_items_base.h>
#include <widgets/text_ctrl_eval.h>
#include <widgets/unit_binder.h>
#include <tools/item_modification_routine.h>
/**
* DIALOG_OUTSET_ITEMS, derived from DIALOG_OUTSET_ITEMS_BASE,
* created by wxFormBuilder
*/
class DIALOG_OUTSET_ITEMS : public DIALOG_OUTSET_ITEMS_BASE
{
public:
DIALOG_OUTSET_ITEMS( PCB_BASE_FRAME& aParent, OUTSET_ROUTINE::PARAMETERS& aParams );
~DIALOG_OUTSET_ITEMS();
protected:
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
void OnLayerDefaultClick( wxCommandEvent& event ) override;
void OnCopyLayersChecked( wxCommandEvent& event ) override;
void OnRoundToGridChecked( wxCommandEvent& event ) override;
private:
PCB_BASE_FRAME& m_parent;
OUTSET_ROUTINE::PARAMETERS& m_params;
UNIT_BINDER m_outset;
UNIT_BINDER m_lineWidth;
UNIT_BINDER m_roundingGrid;
};