SimA
Member-
Posts
114 -
Joined
-
Last visited
Reputation
35 GreatPersonal Information
-
Location
Switzerland
Recent Profile Visitors
7,134 profile views
-
@DomC Ist es möglich, den NC-Code eines Makros mit einer Marionette in das Makro platziert zu bekommen? Der Code ist oft bekannt und das Makro an der Maschine meistens bereits erstellt. Mindestens der Aufruf "Create Makro"... Ansonsten bekomme ich keine Verknüpfung zur Maschine. Weshalb das Ganze? Die Kontrollgeometrie hat jeweils eine starre Grösse. Mit der Marionette könnten sowohl der Code wie auch die Erscheinung gleichzeitig und vor allem richtig angepasst werden. Makro.vwx
-
-
@KingChaos nur das was im DE Forum läuft. Das Interesse wird befeuert und wächst 😉
-
import vs import math import Marionette @Marionette.NodeDefinition class Params(metaclass=Marionette.OrderedClass): # Erscheinungsbild # Name this = Marionette.Node("Get Point on Poly and Distance") this.SetDescription('Gibt einen Punkt an der angegebenen Entfernung entlang des Polygons zurück, beginnend vom ersten Eckpunkt des Polygons, und berechnet die Entfernung zwischen zwei Punkten') # Eingabeanschlüsse poly = Marionette.PortIn(vs.Handle(0), 'hPoly') poly.SetDescription("Das Eingabepolygon") nDist = Marionette.PortIn(0, 'nDist') nDist.SetDescription("Die angegebene Entfernung") p1 = Marionette.PortIn((0, 0), 'p1') p1.SetDescription("Ein 2D-Punkt, der den Startpunkt repräsentiert") nSehne = Marionette.PortIn(0, 'nSehne') nSehne.SetDescription("Eine angegebene Länge, die den Radius eines Kreises repräsentiert") # OIP-Steuerungen tolerance = Marionette.OIPControl('Toleranz', Marionette.WidgetType.Text, '0.0000000000001') tolerance.SetDescription("Ein akzeptabler Unterschied zwischen den berechneten und approximierten Werten") # Ausgabeanschlüsse p2 = Marionette.PortOut('p2') p2.SetDescription("Der Ergebnispunkt") vTan = Marionette.PortOut('vTan') vTan.SetDescription("Der Vektor tangential zum Polygon am Ergebnispunkt") b = Marionette.PortOut('b') b.SetDescription("True, wenn der Knoten seine Aufgabe erfolgreich abschließt, sonst False") # VERHALTEN def RunNode(self): # Eingaben poly = self.Params.poly.value dist = self.Params.nDist.value tolerance = self.Params.tolerance.value p1 = self.Params.p1.value nSehne = self.Params.nSehne.value # Skript result = vs.PointAlongPolyN(poly, dist, tolerance) p2 = result[1] vTan = result[2] # Berechnen der Entfernung zwischen p1 und p2 c = Marionette.TupleMap(lambda x, y: (y - x) ** 2, p1, p2) l = math.sqrt(sum(c)) # Annäherung in noch kleineren Schritten und Präzisierung in noch kleineren Schritten while l < nSehne: new_dist = dist + 0.000001 # Annäherung in noch kleineren Schritten if new_dist >= nSehne: # Überprüfe, ob die neue Entfernung nSehne überschreiten würde break else: # Präzisierung in noch kleineren Schritten step = 0.00000001 while dist < new_dist: dist += step result = vs.PointAlongPolyN(poly, dist, tolerance) p2 = result[1] vTan = result[2] c = Marionette.TupleMap(lambda x, y: (y - x) ** 2, p1, p2) l = math.sqrt(sum(c)) # Ausgaben self.Params.b.value = result[0] # Koordinaten mit höherer Genauigkeit erfassen self.Params.p2.value = (round(result[1][0], 15), round(result[1][1], 15)) self.Params.vTan.value = result[2]
-
The chord is now calculated from p1. However, processing the list would also have to use a sequence of consecutive points. How do I have to incorporate this into the code? import vs import math import Marionette @Marionette.NodeDefinition class Params(metaclass=Marionette.OrderedClass): # APPEARANCE # Name this = Marionette.Node("Get Point on Poly and Distance") this.SetDescription('Returns a point at the specified distance along the poly starting from the first vertex of the poly, and calculates the distance between two points') # Input Ports poly = Marionette.PortIn(vs.Handle(0), 'hPoly') poly.SetDescription("The input poly") nDist = Marionette.PortIn(0, 'nDist') nDist.SetDescription("The specified distance") p1 = Marionette.PortIn((0, 0), 'p1') p1.SetDescription("A 2D point representing the start point") nSehne = Marionette.PortIn(0, 'nSehne') nSehne.SetDescription("A specified length representing the radius of a circle") # OIP Controls tolerance = Marionette.OIPControl('Tolerance', Marionette.WidgetType.Text, '0.0000001') tolerance.SetDescription("An acceptable difference between the calculated and approximate values") # Output Ports p2 = Marionette.PortOut('p2') p2.SetDescription("The result point") vTan = Marionette.PortOut('vTan') vTan.SetDescription("The vector tangent to the poly at the result point") b = Marionette.PortOut('b') b.SetDescription("True if the node completes its job successfully, false otherwise") # BEHAVIOR def RunNode(self): # inputs poly = self.Params.poly.value dist = self.Params.nDist.value tolerance = self.Params.tolerance.value p1 = self.Params.p1.value nSehne = self.Params.nSehne.value # script result = vs.PointAlongPolyN(poly, dist, tolerance) p2 = result[1] vTan = result[2] # Calculate distance between p1 and p2 c = Marionette.TupleMap(lambda x, y: (y - x) ** 2, p1, p2) l = math.sqrt(sum(c)) # If the distance between p1 and p2 is greater than or equal to nSehne, extend the distance until it reaches nSehne while l < nSehne: dist += 1 # Increase dist by 1 unit result = vs.PointAlongPolyN(poly, dist, tolerance) p2 = result[1] vTan = result[2] c = Marionette.TupleMap(lambda x, y: (y - x) ** 2, p1, p2) l = math.sqrt(sum(c)) # outputs self.Params.b.value = result[0] self.Params.p2.value = result[1] self.Params.vTan.value = result[2]
-
Hallo @MullinRJ Most are different.
-
Hello everyone I plan and project kitchens, shop fittings, bakeries, counters and much more. Until recently, these were mostly cubic and angular. Organic forms are now often required. The furniture usually has fixed axis lengths or standard widths. "Point on Poly" works more or less well because the chord is too short because the length is calculated along the polyline. Now when it comes to execution, I have to determine the intersection points with circles. This procedure takes a lot of time because several drawings often have to be made. I have attached my file with the current marionette. This certainly explains it better than my Google translated one. Another thought: a curved line is always longer than a direct straight line connecting two points. I tried using a loop in the code to move the point on the line until it was at the intersection of the chord. The shifting was done, for example, in tenths of the difference between chord and nDist up to an accuracy of 0.000000x. The problem was that the point was calculated from the polyline starting point. However, I would need a continuous calculation from point A to B to C etc. Unfortunately, I failed because of my ignorance and GPT. Thank you for all your ideas! Kontur Aufteilung.vwx
-
Hello everyone I'm looking for a way or node like "point on poly". However, the point on the polyline should be defined by the chord and not the distance along the guideline. Thanks for your help.
-
-
I think it's not a rookie mistake. Nurbs curves can be created, but they do not close. You have to create the Nurb surface from the 4 points differently. Upload the file and the professionals can show us how it works.
-
Eigentlich habe ich gerade keine passende Lösung dazu. Ich verwende oft Klassen-oder Ebenenstempel leider konnte ich bisher die Ebenenreihenfolge oder ähnliches nicht einbauen. Die AB Beschriftung ist sowas ähnliches. Im Layout kannst du die Texte mit DB-Feldern verlinken... Ich denke, der Masstab müsste auch verfügbar sein. Ev. gibt es bei den Architektur-Beschriftungen in der VW-Biliothek irgendwo eine Beschriftung wo du das Feld rausnehmen kannst. Ansonsten suche ich jeweils in einer normalen Tabelle nach der entsprechenden "Funktion, Alle, ???". Wenn du dort fündig wirst ok. Wenns noch immer nicht geht, dann kannst du vielleicht den Masstab mit einer Marionette auslesen und anschliessend direkt an dem Ansichtsbereich als DB anhängen --> Datenstempel auf AB anwenden... Die Korpus Daten sind dann etwas komplexer. Der AB hat keine Ahnung was er überhaupt zeigt. Daher musst du womöglich den Korpus in die Klasse des ABs legen. Da es die gleiche Klassen aufweist, kannst du den Möbelnamen mit der Klasse abgleichen und anzeigen lassen. Meine Angaben sind lediglich Gedanken.
-
Hallo Jodak welche infos soll die Beschriftung erhalten? Baugruppe, Möbelname, Position…
-
-
The vectors can be determined with three points. The rotation angles around the two axes X&Y can then be calculated from the vectors. In the case of a pyramid, these can be two corner points and the top.
-