FreeCAD Logo FreeCAD 1.0
  • Engleski Afrički Arapski Bjeloruski Katalonski Češki Njemački Grčki Španjolski Španjolski Baskijski Finski Filipinski Francuski Galicijski Hrvatski Mađarski Indonezijski Talijanski Japanski Kabilski Korejski Litvanski Nizozemski Norveški (Bokmal) Poljski Portugalski Portugalski Rumunjski Ruski Slovački Slovenski Srpski Švedski Turski Ukrajinski Valencijski Vijetnamski Kineski Kineski
  • Osobine
  • Preuzmi
  • Blog
  • Dokumentacija
    Sadržaj dokumentacije Prvi koraci Korisnička dokumentacija Uputstvo za korisnike FreeCAD-a Radne Površine Dokumentacija Python dokumentacija programiranja C++ coding dokumentacija Vježbe Često postavljena pitanja Privacy policy O FreeCAD-u
  • Doprinesi
    Kako pomoči Sponsor Prijavi grešku Stvorite zahtjev za povlačenjem Radna mjesta i financijranje Pravila sudjelovanja Priručnik za programere Prijevodi
  • Zajednica
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA informacija
Molimo postavite svoj SEPA bankovni prijenos na:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Agencija banke: BNP Paribas Fortis
Adresa: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

(parametarski!)

Odjeljak

Opis
Alternativna provedba Part Section alat (parametarski)

Makronaredba verzije : 1.1
Datum zadnje izmjene : 2018-04-28
Verzija FreeCAD : All
Preuzimanje datoteka : ToolBar Icon
Autor : DeepSOIC
Autor
DeepSOIC
Preuzimanje datoteka
ToolBar Icon
Linkovi
Makro recepti
Kako instalirati makronaredbe
Kako prilagoditi alatne trake
Verzija
1.1
Datum zadnje izmjene
2018-04-28
Verzije FreeCAD-a
All
Zadani prečac
None
Vidi također
None

Part Section alat proizvodi rubove s kontinuitetom C0 i velikim brojem segmenata (čvorova), što nije baš prikladno kaoSweep staza.

Ovaj makronaredba čini isto izdvajanjem rubova odjeljka iz rezultata općeglasa (GFA). Rezultat je C1-kontinuiran i ima manje čvorova. To još uvijek nije sjajno za čišćenje, ali puno bolje od običnog dijela.

Zahtijeva FreeCAD v0.17 + izgrađen protiv OCC ne manje od 6.9.0 (testirano na 7.0.0).

Installation

Instalacija:

preuzmite datoteku i spremite je u makro direktorij:

https://github.com/DeepSOIC/FreeCAD-Macros/raw/master/Section/MacroSection.py

How to use

Kako koristiti:

  1. Odaberite dva oblika za izračun odjeljka
  2. U FreeCAD izborniku: Makro → Makro ... → dvaput kliknite MacroSection.py. Stvorit će se novi objekt.

Nakon pokretanja makronaredbe, možete dodati gumb alatne trake. Idite na Alati → Prilagodi, Alatne trake, odaberite MacroSection na lijevom padajućem popisu i dodajte naredbu bilo kojoj od vaših prilagođenih alatnih traka.

Skripta

ToolBar Icon

MacroSection.py

#***************************************************************************
#*                                                                         *
#*   Copyright (c) 2016 - Victor Titov (DeepSOIC)                          *
#*                                               <vv.titov@gmail.com>      *  
#*                                                                         *
#*   This program is free software; you can redistribute it and/or modify  *
#*   it under the terms of the GNU Lesser General Public License (LGPL)    *
#*   as published by the Free Software Foundation; either version 2 of     *
#*   the License, or (at your option) any later version.                   *
#*   for detail see the LICENCE text file.                                 *
#*                                                                         *
#*   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 Library General Public License for more details.                  *
#*                                                                         *
#*   You should have received a copy of the GNU Library General Public     *
#*   License along with this program; if not, write to the Free Software   *
#*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
#*   USA                                                                   *
#*                                                                         *
#***************************************************************************

__title__="Macro Section"
__author__ = "DeepSOIC"
__doc__ = '''
Macro Section.
Alternative implementation of Part Section tool.
Requires FreeCAD v0.17+ and OCC 6.9.0+

Instructions:
First of all, save this macro as MacroSection.py, into a location from where it can be imported. FC's standard macro location is the best place to do that.

Select two shapes to compute section between.
Then, in Py console:

import MacroSection
MacroSection.run()

OR

just run this file as a macro.

Parametric Section object is created.
'''
if __name__ == "__main__": #being run as a macro
    import MacroSection
    MacroSection.run()

import FreeCAD as App
if App.GuiUp:
    import FreeCADGui as Gui
import Part

def makeSectionFeature():
    '''makeSectionFeature(): makes a Section parametric feature object. Returns the new object.'''
    selfobj = App.ActiveDocument.addObject("Part::FeaturePython","Section")
    Section(selfobj)
    ViewProviderSection(selfobj.ViewObject)
    return selfobj

class Section:
    "The Section feature object"
    def __init__(self,selfobj):
        selfobj.addProperty("App::PropertyLink","Base","Section","Input shape")
        selfobj.addProperty("App::PropertyLink","Tool","Section","Input shape")
        selfobj.Proxy = self

    def execute(self,selfobj):
        import BOPTools
        import BOPTools.ShapeMerge
        from BOPTools.Utils import HashableShape
        
        if len(selfobj.Base.Shape.Faces) == 0 or len(selfobj.Tool.Shape.Faces) == 0:
            raise ValueError("Shapes must have at least one face each.")
        sh1 = Part.Compound(selfobj.Base.Shape.Faces)
        sh2 = Part.Compound(selfobj.Tool.Shape.Faces)
        pieces, map = sh1.generalFuse([sh2])
        pieces = pieces.childShapes()
        assert(len(pieces) == 2)
        
        edges1 = set([HashableShape(edge) for edge in pieces[0].Edges])
        edges2 = set([HashableShape(edge) for edge in pieces[1].Edges])
        edges_to_return = list(set.intersection(edges1, edges2))
        edges_to_return = [edge.Shape for edge in edges_to_return] #convert hashable shapes back to plain shapes
        print("returning {num} edges of total {tot}".format(num= len(edges_to_return), tot= len(edges1)+len(edges2)))
        
        selfobj.Shape = BOPTools.ShapeMerge.mergeWires(edges_to_return)

class ViewProviderSection:
    def __init__(self,vobj):
        vobj.Proxy = self
       
    def getIcon(self):
        return ":/icons/Part_Section.svg"

    def attach(self, vobj):
        self.ViewObject = vobj
        self.Object = vobj.Object
  
    def __getstate__(self):
        return None

    def __setstate__(self,state):
        return None

    def claimChildren(self):
        return [self.Object.Base, self.Object.Tool]
        
    def onDelete(self, feature, subelements): # subelements is a tuple of strings
        try:
            self.Object.Base.ViewObject.show()
            self.Object.Tool.ViewObject.show()
        except Exception as err:
            App.Console.PrintError("Error in onDelete: " + err.message)
        return True

class CommandMacroSection:
    "Command to create Section feature"
    def GetResources(self):
        return {'Pixmap'  : ":/icons/Part_Section.svg",
                'MenuText': "Section",
                'Accel': "",
                'ToolTip': "Macro_Section: alternative implementation of Part Section tool"}

    def Activated(self):
        run()
    def IsActive(self):
        if App.ActiveDocument:
            return True
        else:
            return False

if App.GuiUp:
    Gui.addCommand("Macro_Section", CommandMacroSection())

def run():
    sel = Gui.Selection.getSelectionEx()
    try:
        if len(sel) != 2:
            raise Exception("Select two shapes to compute section between, first! Then run this macro.")
        try:
            App.ActiveDocument.openTransaction("Macro Section")
            selfobj = makeSectionFeature()
            selfobj.Base = sel[0].Object
            selfobj.Tool = sel[1].Object
            selfobj.Base.ViewObject.hide()
            selfobj.Tool.ViewObject.hide()
            
            selfobj.Proxy.execute(selfobj)
        finally:
            App.ActiveDocument.commitTransaction()
    except Exception as err:
        from PySide import QtGui
        mb = QtGui.QMessageBox()
        mb.setIcon(mb.Icon.Warning)
        mb.setText(err.message)
        mb.setWindowTitle("Macro Section")
        mb.exec_()

Ova stranica je preuzeta s https://wiki.freecad.org/Macro_Section

Kontaktirajte nas!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

Ovaj projekt je podržan od: , KiCad Services Corp. i drugi sponzori

GitHubPoboljšaj ovu stranicu na GitHub-u