[Draft] circular array
[Draft] circular array
Hallo,
ich habe mir das Draft→Array tool um ein circular Array erweitert um runde Lüftungsgitter machen zu können: So richtig Sinn macht es nur mit Kreisen oder „quadratischen“ Formen, weil die Objekte sich nicht mitdrehen (die zu lösende Frage wäre wo der Mittelpunkt liegt).
Ist sowas von allgemeinem Interesse oder ist das zu speziell?
Eigentlich hätte ich sowas ja viel lieber in Sketcher oder PartDesign.
ich habe mir das Draft→Array tool um ein circular Array erweitert um runde Lüftungsgitter machen zu können: So richtig Sinn macht es nur mit Kreisen oder „quadratischen“ Formen, weil die Objekte sich nicht mitdrehen (die zu lösende Frage wäre wo der Mittelpunkt liegt).
Ist sowas von allgemeinem Interesse oder ist das zu speziell?
Eigentlich hätte ich sowas ja viel lieber in Sketcher oder PartDesign.
Re: [Draft] circular array
Das wäre eine sinnvolle Verallgemeinerung, die auch zu den umfangreicheren Möglichkeiten des linearen Arrays passt. Und vielleicht magst Du Dich in die PartDesign-Patterns auch einarbeiten, da gibt es ja noch so ein paar Restarbeiten zu eredigen.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Draft] circular array
Hab’s dann mal um einen Symmetrieparameter und z-Achse ergänzt und einen Pull-Request gemacht:
https://github.com/FreeCAD/FreeCAD/pull/2579
(Aus irgendwelchen Gründen sind bei (meiner) git-Version die Kreise nicht mehr gefüllt)
https://github.com/FreeCAD/FreeCAD/pull/2579
(Aus irgendwelchen Gründen sind bei (meiner) git-Version die Kreise nicht mehr gefüllt)
- Attachments
-
- Screenshot_20191004_201253.png.png (200.39 KiB) Viewed 2972 times
Re: [Draft] circular array
Ich würde aber vorher noch hinzufügen, dass die Objekte auch rotiert werden, damit das einheitlich ist (ist beim normalen polar Array ja auch so).
Re: [Draft] circular array
Dann braucht man aber eine Rotationsachse und ein Rotationszentrum, was das ganze komplizierter macht. Nicht nur die Implementierung sondern auch die Anwendung.
Re: [Draft] circular array
- Attachments
-
- Screenshot_20191005_223141.png (104.88 KiB) Viewed 2852 times
Re: [Draft] circular array
Es sieht gut aus!
Re: [Draft] circular array
New tool: Draft_CircularArray. Please check the information.rynn wrote: ↑Sat Oct 05, 2019 8:33 pm Neuer Pull-Request:
https://github.com/FreeCAD/FreeCAD/pull/2585
Can you explain exactly what the symmetry value represents? It's seems to be a parameter that controls the polar angle of each element placed in the circular pattern. The bigger this value is the sparser the elements are.
Code: Select all
def circArray(self,pl,rdist,tdist,axis,center,cnum,sym):
import Part
sym = max(1, sym)
lead = (0,1,0)
if axis.x == 0 and axis.z == 0: lead = (1,0,0)
direction = axis.cross(Vector(lead)).normalize()
base = [pl.copy()]
for xcount in range(1, cnum):
rc = xcount*rdist
c = 2*rc*math.pi
n = math.floor(c/tdist)
n = int(math.floor(n/sym)*sym)
if n == 0: continue
angle = 360/n
for ycount in range(0, n):
npl = pl.copy()
trans = FreeCAD.Vector(direction).multiply(rc)
npl.translate(trans)
npl.rotate(npl.Rotation.inverted().multVec(center-trans), axis, ycount*angle)
base.append(npl)
return base
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: [Draft] circular array
It’s the symmetrie of the array
With symmetry = 1 you might have to rotate the array 360° to match positions on itself, with symmetry = 2 a rotation of 180° is always sufficient, with symmetry = 3 a rotation of 120°, … with symmetry = n a rotation of 360°/n.
if symmetry gets higher the number of objects in some circle decreases, it even might not be possible to place objects in the inner circle(s) at all.
Re: [Draft] circular array
Would you mind adding this to the wiki?rynn wrote: ↑Wed Jan 22, 2020 7:32 am With symmetry = 1 you might have to rotate the array 360° to match positions on itself, with symmetry = 2 a rotation of 180° is always sufficient, with symmetry = 3 a rotation of 120°, … with symmetry = n a rotation of 360°/n.
symmetry.png.png
if symmetry gets higher the number of objects in some circle decreases, it even might not be possible to place objects in the inner circle(s) at all.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.