Español
PHP, HTML & JavaScript- Foro

3D Grafik - WebGL con three.js

 
- Página 1 -



HofK
Auf una heißen Tipp de IF hin, Yo me de tiempo
three.js  [...]  angeschaut. Como  [...]  (bastante unten) el ersten Resultate.
 
31.01.2016  
 



 
- Página 30 -



HofK
Alle Ecken el Dreiecke son en el Pufferfeld el Positionen gespeichert.
Somit puede ser beliebige Längen berechnen, si uno el benötigten Indizes ha.
g.indices = new Uint32Array( faceCount * 3 );
g.positions = new Float32Array( posCount * 3 );
//g.normals = new Float32Array( posCount * 3 );
g.setIndex( new THREE.BufferAttribute( g.indices, 1 ) );
g.setAttribute('position', new THREE.BufferAttribute( g.positions, 3 ) );

Aus verschiedenen Gründen speichere Yo el primären Positionen para el Löcher en un normalen array let pos = []; mittels pos.push( x, y, z ); zwischen.

Damit berechnen el Längen muy simplemente. Como el Löcher auch stärkere Krümmungen enthalten, Yo el Iterationsabbruch en 90% el ungefähren Seitenlänge el Dreiecke gesetzt.
////////// console //////////////////////////////////////////////
let lx,ly,lz;
console.log('g.d', g.d ); //// rough side length of the triangles

for ( let i = 3; i < pos.length; i += 3 ) {//	uses sqlen0 < 0.81 * dd, equals 0.9*d

    lx = pos[ i     ] - pos[ i - 3 ];
    ly = pos[ i + 1 ] - pos[ i - 2 ];
    lz = pos[ i + 2 ] - pos[ i - 1 ];
    console.log('length',length( lx, ly, lz) ); // 0.9*d = 0.135

}

////////////////////////////////////////////////////////////////////

Für dieses kleine Löchlein ergeben se folgende Werte.

 
11.11.2019  
 




p.specht

Gracias, el gibt´s also. Für FEM etc. debería uno todavía el Richtungen wissen. Aber el restos ohnehin Spezialisten überlassen. Como en el representation sólo Flächen vorkommen, lo hay aber en Trägheitsmomente, Massenverteilungen, Materialsteifigkeiten etc. ankommt, restos hier Zukunftsmusik. War auch sólo así una Concepto - Yo hatte veces una 16bit-Programa para FEM, el bastante bien war. Läuft natürlich no mehr.
Gruss
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
11.11.2019  
 




HofK
Mit FEM (Finite-Elemente-Método) Yo mich no beschäftigt. Como benötigt uno aber Teilkörperchen des Gesamtkörpers. Mi "Körper" son sólo Oberflächen. El Löcher erzeuge Yo para el Innengeometrie, siehe Contribución vom 25.09. Ansonsten puede ser el zusammengesetzten Oberflächen simplemente por Überschneidung generieren.
 
12.11.2019  
 




HofK
El bisher todavía fehlenden Varianten Zylinder-Zylinder son soweit fertig.

Ein verbundenes Loch:





Zwei Löcher:





Knappe Sache:



Nun todavía algo Fleißarbeit beim Aufräumen y optimieren des Codes.
 
16.11.2019  
 




p.specht

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
16.11.2019  
 




HofK
HofK (16.11.2019)
Nun todavía algo Fleißarbeit beim Aufräumen y optimieren des Codes.


Zu Euphorisch


Mit el Kugel al Zylinder es perfekt.



Aber beim más Zusammenbau el Körper Yo festgestellt, dass Yo en el Enden el Zylinder siempre todavía sólo el primitive Variante con teils verzerrten Seitenlängen el Dreiecke habe.



Also todavía una wenig Arbeit.



Es todavía no bastante perfekt, el iterative Rechnung bringt en Loch y Zylinderende ligeramente diferente Ergebnisse. Como muss Yo tiefer prüfen.

El Formel es auch no muy übersichtlich:

Dabei necesario el Variables wegen el Lage el Öffnung auch todavía vertauscht voluntad. psi es el umlaufende Winkel, tilt es el Neigungswinkel, exc el Exzentrik.
 
20.11.2019  
 




p.specht

Laufmasche, sozusagen ... Como wär´s con un Ausgleichsstück, überlagernd? Zuschweissen probablemente más no gelingen
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
20.11.2019  
 




HofK
Tuve más a kleben pensamiento, aber el verschmiert el Display. Lötzinn sería wohl abperlen y schweißen wäre en una alten Röhrenmonitor sicher una schönes Implosions-Experiment.

Also entonces doch más bien media Soft-JavaScript-Tacker benutzen!

Das Problema liegt en el ligeramente unterschiedlichen Umsetzungen el Iteration. Desde que lo para el unterschiedlichen Fronten nacheinander experimentell ermittelt habe, hay feine Unterschiede en el Algorithmus. A Optimierung des Codes muss el ohnehin vereinheitlicht voluntad, en ähnliche /identische Codeabschnitte no mehrfach a haben.

Der gegenwärtige Stand ergibt el folgende allgemeine Función
function makeFrontPos( xyzCalc ).
Dieser se el konkrete Función para el Schnittlinie transferencia
function xyzCalcSphHole( ) para el Kugel (Schnitt con Zylinder).

Ausgangswerte voluntad en el Triangulations-Hauptfunktion gesetzt en Parameterübergaben a sparen. Das entspricht meiner Vorgehensweise beim Triangulationsprojekt.

Nätürlich anfangs otra vez una schöne Fehldarstellung. Sie zeigt nochmals el hohe Stabilität el Triangulation en fehlerhaften Fronten.



function makeFrontPos( xyzCalc ) {

    psi = psiStart;
    dpsi = Math.PI * 2 / g.detail / 16;
    sqlen1 = 9 * dd;// initial
    xyzCalc( );// start point
    pos.push( x, y, z );
    // notice start point
    x0 = x;
    y0 = y;
    z0 = z;

    if ( psi !== psiEnd ) {

        psi = psiEnd;
        xyzCalc( );
        psi = psiStart;// initial again

    }

    // notice endpoint to check finish
    x1 = x;
    y1 = y;
    z1 = z;

    mientras que ( sign > 0 ? psi < psiEnd && ( sqlen1 > 5.76 * dd || psi < ( psiEnd - psiStart ) / 2 ) : psi > psiEnd && ( sqlen1 > 5.76 * dd || psi > ( psiStart - psiEnd ) / 2 ) ) {

        // (adaptive-deformed) circle
        psi0 = psi;
        sqlen0 = 0;

        mientras que ( sqlen0 < 0.81 * dd ) {

            psi += sign * dpsi;
            xyzCalc( );
            dx = x - x0;
            dy = y - y0;
            dz = z - z0;
            sqlen0 = squareLength( dx, dy, dz );

        }

        pos.push( x, y, z );

        if ( slope ='dx' )	{

            dyzdx = Math.abs( Math.sqrt( dy * dy + dz * dz ) / dx );
            dyzdx = dyzdx > 1 ? 1 : dyzdx;
            dpsi = Math.abs( psi - psi0 ) * dyzdx / 16;

        } más {// 'dy'

            dxzdy = Math.abs( Math.sqrt( dx * dx + dz * dz ) / dy );
            dxzdy = dxzdy > 1 ? 1 : dxzdy;
            dpsi = Math.abs( psi - psi0 ) * dxzdy / 16;

        }

        x0 = x;
        y0 = y;
        z0 = z;
        dx = x - x1;
        dy = y - y1;
        dz = z - z1;
        sqlen1 = squareLength( dx, dy, dz );

    }

    // possibly a intermediate point

    if( sqlen1 > 1.44 * dd )  {

        psi += ( psiEnd - psi ) / 2 ;
        /* or
        a = y1 === 0 ? 3 : 2;
        psi += a * ( psiEnd - psi ) / 4;
        */
        xyzCalc( );
        pos.push( x, y, z );

    }

    if( !openFrt ) pos.push( x1, y1, z1 );

}


// partial front:
// y = sqrt( rSph * rSph - g.radius * g.radius - exc * exc - 2 * g.radius * exc * cos( psi ) )
rex = rSph * rSph - g.radius * g.radius - exc * exc;
sign = 1;
psiStart = Math.PI;// initial
psiEnd = psiStart + Math.acos( rex / ( -2 * g.radius * exc ) );
openFrt = falso;
slope ='dy';
pos = [];
makeFrontPos( xyzCalcSphHole );


 
24.11.2019  
 




HofK
El Ergänzung el Fronten a Anpassung de Zylinder y Kugel a el Enden des Zylinders ha mehr Arbeit gemacht como pensamiento.

Aber así sieht lo bastante praktikabel de.





El Parámetro des Beispiels. Unten passt una Zylinder dran, oben una Kugel.
const parámetros =  {

    d: 0.15,// rough side length of the triangles
    div4: 15,// division of the quarter circle
    geoBtm:'cylinder', //  'cylinder', 'sphere', solid to be adapted
    bottom: -3.0,
    div4Btm: 34,// division bottom adaptation, (to quarter, >= div4)
    phiBtm: 0,// rotation of adaptive-deformed circle (Bottom)
    excBtm: 1.8049,
    //tiltBtm: 0.0, // tilt of bottom adaption ( -PI/2 < tilt < PI/2 )
    geoTop:'sphere', // 'sphere', solid to be adapted
    top: 1.0,
    div4Top: 34,// division top adaptation, (to quarter, >= div4)
    phiTop: 0,// rotation of adaptive-deformed circle (Top)
    excTop: 1.8049,
    //tiltTop: 0.0, // tilt of top adaption ( -PI/2 < tilt < PI/2 )
    holes: [
    // unit: '%' of the radius, 'd' factor to d, 'v' value
    //  hole to conect a sphere:  [ 'sphere', div4AdpSph, y, phi, exc, unit ]
    ['sphere', 16, -1.11, 0,  2.686, 'v' ],
    // hole to conect a cylinder: [ 'cylinder', div4AdpCyl, y, phi, exc, unit, tilt, <optional: side> ]
    ['cylinder', 8,  -2.2, 1.57, 50, '%', -0.22, '+-' ],
    //points hole,: array of points y, phi, ...  (last point is connected to first)
    [ 0.15,0.45, 0.5,0.9, 0.8,0.6, 0.75,-0.2, 0.1,-0.15  ]
    ]

}


Lo waren algunos Características a gestalten.



Nun son todavía "Restarbeiten" nötig. 
 
07.12.2019  
 




p.specht

Gratulation! Das war sicher una grössere Hürde! Jetzt wären wahrscheinlich algo como como Makros hilfreich, el el Fälle unterscheiden helfen - sonst restos lo Hand-/Kopfarbeit. Como sieht lo de paso con Bemaßung de?
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
08.12.2019  
 




HofK
Bemaßungen son kein Problema, Yo pero no vorgesehen. Man características Linien y kleine Dreiecke como Spitzen. El Ziffern puede ser en diferente Weise erzeugen. Por ejemplo así, Yo lo para mi NumbersHelper gemacht habe, z.B.  [...] 

Zwischendurch Yo después de langer Tiempo otra vez veces shader betrachtet.  [...] 
y me ni otro Sache "eingehandelt" como Yo encima una pequeña Fehler gestolpert bin.  [...] 
 
09.12.2019  
 




p.specht

Maßzahlen, el no mitdrehen: Wow, super!

Como podría uno una Schnittebene en el Objeto legen, sodaß sólo el detrás de él-befindliche Teil suscrito se (z.B. Stockwerkspläne) ?
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
10.12.2019  
 




Respuesta


Título del Tema, max. 100 Signo.
 

Systemprofile:

Kein Systemprofil creado. [anlegen]

XProfan:

 Contribución  Font  Smilies  ▼ 

Bitte registro en una Contribución a verfassen.
 

Tema opciones

357.293 Views

Untitledvor 0 min.
Paul Glatz vor 18 Tagen
Uwe ''Pascal'' Niemeier23.03.2025
Manfred Barei18.03.2025
R.Schneider05.03.2025
Más...

Themeninformationen



Admins  |  AGB  |  Applications  |  Autores  |  Chat  |  Política de Privacidad  |  Descargar  |  Entrance  |  Ayuda  |  Merchantportal  |  Pie de imprenta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Juegos  |  Búsqueda  |  Support

Ein Projekt aller XProfan, el lo son!


Mi XProfan
Privado Noticias
Eigenes Ablageforum
Temas-Merkliste
Eigene Beiträge
Eigene Temas
Zwischenablage
Cancelar
 Deutsch English Français Español Italia
Traducciones

Política de Privacidad


Wir uso Cookies sólo como Session-Cookies wegen el technischen Notwendigkeit y en uns hay no Cookies de Drittanbietern.

Wenn du hier en unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung de Informationen en unseren Cookies en XProfan.Net a.

Weitere Informationen a unseren Cookies y dazu, como du el Kontrolle darüber behältst, findest du en unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Yo möchte no Cookie