FreeCAD Logo FreeCAD 1.0
  • Englisch Afrikaans Arabisch Weißrussisch Katalanisch Tschechisch Deutsch Griechisch Spanisch Spanisch Baskisch Finnisch Philippinisch Französisch Galicisch Kroatisch Ungarisch Indonesisch Italienisch Japanisch Kabylisch Koreanisch Litauisch Niederländisch Norwegisches Bokmål Polnisch Portugiesisch Portugiesisch Rumänisch Russisch Slowakisch Slowenisch Serbisch Schwedisch Türkisch Ukrainisch Valencianisch Vietnamesisch Chinesisch Chinesisch
  • Funktionen
  • Herunterladen
  • Blog
  • Dokumentation
    Inhaltsverzeichnis Erste Schritte Benutzerdokumentation Das FreeCAD-Handbuch Dokumentation der Arbeitsbereiche Python-Dokumentation Dokumentation der C++ Programmierung Anleitungen Häufig gestellte Fragen Datenschutzrichtlinie Über FreeCAD
  • Mitwirken
    Wie kann ich helfen Sponsor Einen Fehler melden Einen Pull Request durchführen Jobs und Finanzierung Richtlinien für Beiträge Entwicklerhandbuch Übersetzungen
  • Community
    Verhaltenskodex Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Kalender
  • ♥ Donate

Donate

$
SEPA-Informationen
Bitte richten Sie Ihre SEPA-Überweisung an:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Kreditinstitut: BNP Paribas Fortis
Adresse: 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!

Linie Schneiden

Beschreibung
Schneidet eine Linie aus, wobei als Argument number cut, create line, bicolor, create point angegeben wird. Die neue Linie wird in der realen Koordinate des Objekts erstellt, nicht in der Koordinate des Körpers.
(Befehlszeile, füge dieses komplette Makro in die Python Konsole ein).

Versionsmakro : 2.0
Datum der letzten Änderung : 2019/06/17
FreeCAD version : Alle
Herunterladen : Werkzeugleisten-Symbol
Autor: mario52
Autor
mario52
Herunterladen
Werkzeugleisten-Symbol
Links
Makros Rezepte
Wie man Makros installiert
Symbolleisten anpassen
Macro-Version
2.0
Datum der letzten Änderung
2019/06/17
FreeCAD-Version(s)
Alle
Standardverknüpfung
None
Siehe auch
None

Beschreibung

Dieses kleine Makro schneidet eine Linie und erzeugt einen Punkt , Linien , zwei Farben der Linie.

Linieschneiden

Anwendung

Kann aus dem Freecad Makro Editor verwendet werden.

  • 4 : Anzahl Schnitte
  • createPoint : Punkte erzeugen oder nicht (0) (Defaut 1)
  • createLine : Linie erzeugen (>0) oder nicht (0) (Defaut 0)
  • biColor : Linie erzeugen biColor (>0) oder nicht (0) (Defaut 0)


Du kannst die Standardwerte im Makro ändern.

Mit biColor werden die Linien auf der ursprünglichen Linie als eine abwechselnd weiß und rote Linie erstellt. Die Farben können im Code angepasst werden; Zeile 20 und 23.

Skript

Werkzeugleisten-Symbol

Macro_cutLine.FCMacro

#################################################################
# https://forum.freecad.org/viewtopic.php?f=3&t=4217&hilit=discretize
# 08/03/2015 2019/06/17

__title__   = "cutLine"
__author__  = "Mario52"
__version__ = "00.02"
__date__    = "2019/06/17"

import Draft, Part
def cutLine(numberOfPoints = 2, createPoint = 1, createLine = 0, biColor = 0):           # create a points of forme

    def createLines(numberOfPoints, points, biColor):                                        # create line
        biscolor = 0
        for lin in range(numberOfPoints-1):
            creaLine = [FreeCAD.Vector(points[lin]),FreeCAD.Vector(points[lin+1])]
            wire = Draft.makeWire(creaLine,closed=False,face=False,support=None)
            if biColor != 0:                                                                 # biColor 
                if biscolor == 0:
                    FreeCADGui.ActiveDocument.getObject(wire.Name).LineColor = (1.0,0.0,0.0) # 255 = 1 (10 = (1/255 * 10 ))
                    biscolor = 1
                else:
                    FreeCADGui.ActiveDocument.getObject(wire.Name).LineColor = (1.0,1.0,1.0) # 255 = 1 (10 = (1/255 * 10 ))
                    biscolor = 0
    try:
        points = []
        points[:] = []
        selectionObjects = FreeCADGui.Selection.getSelectionEx()         # getSelectionEx
        numberOfPoints += 1
        for selection in selectionObjects:
            compteur = pas = 0
            for selectedEdge in selection.SubObjects:
                    FreeCAD.Console.PrintMessage(selectionObjects[0].SubElementNames[compteur] + "\n")                   
#                    print( selectionObjects[0].SubElementNames[compteur])# getSelectionEx
                    compteur += 1                                              
                    points = selectedEdge.discretize(numberOfPoints)   
                    if createLine != 0:
                        createLines(numberOfPoints, points, biColor)
                    for p in points:
                        if createPoint != 0:
                            Draft.makePoint( p.x, p.y, p.z)
                        FreeCAD.Console.PrintMessage(str(compteur)+" X"+ str(p.x)+" Y"+ str(p.y)+ " Z"+ str(p.z) + "\n")
#                        print( compteur," X", p.x, " Y", p.y, " Z", p.z)
                    pas = 1                                              #

            if pas == 0:                                                 # the not SubObjects
                selectionObjects = FreeCADGui.Selection.getSelection()   # select all elements
                FreeCAD.Console.PrintMessage(selectionObjects[0].Name + "\n")
#                print( selectionObjects[0].Name)                         # getSelection()
                compteur = 0
                for ii in enumerate(selectionObjects[0].Shape.Edges): 
                    compteur += 1
                    points = ii[1].discretize(numberOfPoints)            # discretize the element
                    for p in points:
                        if createPoint != 0:
                            Draft.makePoint( p.x, p.y, p.z)              # create points
                        FreeCAD.Console.PrintMessage(str(compteur)+" X"+ str(p.x)+" Y"+ str(p.y)+ " Z"+ str(p.z) + "\n")
#                         print( compteur, " X", p.x, " Y", p.y, " Z", p.z)  # list and display the coordinates
                    if createLine != 0:
                        createLines(numberOfPoints, points, biColor)
    except:
        FreeCAD.Console.PrintError("Error" + "\n" + "Give : cutLine(numberOfPoints = 2, createPoint = 1, createLine = 0, biColor = 0)"+"\n")
        FreeCAD.Console.PrintError("Select the complete shape or separate wire(s) line, circle ..."+"\n")

#        print( "Error : Give cutLine(numberOfPoints = 2, createPoint = 1, createLine = 0, biColor = 0)")

# Example in command line (paste the macro in FC Python console) and write:
#cutLine(2, createLine = 1, biColor = 1, createPoint = 0)

Beispiel

Kann aus dem Freecad Makro Editor verwendet werden.

Wenn das Makro in die Python Konsole kopiert wird, kannst du es folgendermaßen verwenden durch:

cutLine(4, createLine = 1, biColor = 1, createPoint = 0)

Verweise

Diese Funktion verwendet die Funktion discretize the original code

Diese Seite wird abgerufen von https://wiki.freecad.org/Macro_Cut_Line

Kontaktiere uns!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© Das FreeCAD-Team. Bildnachweis (von oben nach unten): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

Dieses Projekt wird unterstützt von: , KiCad Services Corp. und andere Sponsoren

GitHubDiese Seite auf GitHub verbessern