[Draft] circular array

In diesem Forum Fragen und Diskussionen in Deutsch
Forum rules
Foren-Regeln und hilfreiche Informationen

WICHTIG: Bitte zuerst lesen, bevor Sie posten
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

[Draft] circular array

Post by rynn »

Hallo,

ich habe mir das Draft→Array tool um ein circular Array erweitert um runde Lüftungsgitter machen zu können:
Screenshot_20190930_211800.png
Screenshot_20190930_211800.png (277.18 KiB) Viewed 3010 times
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.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: [Draft] circular array

Post by chrisb »

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.
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: [Draft] circular array

Post by rynn »

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)
Attachments
Screenshot_20191004_201253.png.png
Screenshot_20191004_201253.png.png (200.39 KiB) Viewed 2945 times
usbhub
Posts: 280
Joined: Tue Apr 02, 2019 8:22 pm
Location: Earth

Re: [Draft] circular array

Post by usbhub »

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).
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: [Draft] circular array

Post by rynn »

usbhub wrote: Fri Oct 04, 2019 8:22 pm 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).
Dann braucht man aber eine Rotationsachse und ein Rotationszentrum, was das ganze komplizierter macht. Nicht nur die Implementierung sondern auch die Anwendung.
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: [Draft] circular array

Post by rynn »

Attachments
Screenshot_20191005_223141.png
Screenshot_20191005_223141.png (104.88 KiB) Viewed 2825 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: [Draft] circular array

Post by triplus »

Es sieht gut aus!
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Draft] circular array

Post by vocx »

rynn wrote: Sat Oct 05, 2019 8:33 pm Neuer Pull-Request:

https://github.com/FreeCAD/FreeCAD/pull/2585
New tool: Draft_CircularArray. Please check the information.

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
Further discussion: Making the creation of arrays more user friendly
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.
rynn
Posts: 454
Joined: Tue Jul 31, 2018 7:00 am

Re: [Draft] circular array

Post by rynn »

vocx wrote: Fri Jan 17, 2020 7:40 am 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.
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.
symmetry.png.png
symmetry.png.png (50.09 KiB) Viewed 2234 times
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.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: [Draft] circular array

Post by chrisb »

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.
Would you mind adding this to the wiki?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply