亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? geometricmodeler.java

?? 基于java的3d開發(fā)庫。對坐java3d的朋友有很大的幫助。
?? JAVA
字號:
//===========================================================================//=-------------------------------------------------------------------------=//= Module history:                                                         =//= - September 23 2007 - Oscar Chavarro: Original base version             =//===========================================================================package vsdk.toolkit.processing;// Java classesimport java.util.ArrayList;// VitralSDK classesimport vsdk.toolkit.common.VSDK;import vsdk.toolkit.common.Vector3D;import vsdk.toolkit.common.Matrix4x4;import vsdk.toolkit.environment.geometry.InfinitePlane;import vsdk.toolkit.environment.geometry.ParametricCurve;import vsdk.toolkit.environment.geometry.PolyhedralBoundedSolid;import vsdk.toolkit.environment.geometry.polyhedralBoundedSolidNodes._PolyhedralBoundedSolidFace;import vsdk.toolkit.environment.geometry.polyhedralBoundedSolidNodes._PolyhedralBoundedSolidLoop;import vsdk.toolkit.environment.geometry.polyhedralBoundedSolidNodes._PolyhedralBoundedSolidHalfEdge;import vsdk.toolkit.environment.geometry.polyhedralBoundedSolidNodes._PolyhedralBoundedSolidVertex;/**This is a utility class containing a lot of geometry operations (mostlygeometry generating and modifying operations). This is a companion classfor the `ComputationalGeometry` class, which holds geometrical querys.This class is comprised of static methods, depending only of VSDK's Entity's.From a design point of view, it can be view as an "strategy" design patternin the sense it encapsulates algorithms. It also could be viewd as a "factory"or "abstract factory", as it is a class for creating objects, followingthe data hierarchy of interface "geometry".From a practical point of use, note this is similar to Java's `Graphics`class in Java2D, as this is the class where user can create graphics primitivesusing mid-level constructs, but note that this class is not responsible ofany rendering, rasterizing or visualization; it only uses data structures.*/public class GeometricModeler extends ProcessingElement{    public static final int UNION = 1;    public static final int INTERSECTION = 2;    public static final int DIFFERENCE = 3;    /**    Creates a 3D line from point (x1, y1, z1) to point (x2, y2, z2).    */    public static ParametricCurve    createLine(double x1, double y1, double z1,               double x2, double y2, double z2)    {        ParametricCurve lineModel;        Vector3D pointParameters[];        lineModel = new ParametricCurve();        pointParameters = new Vector3D[1];        pointParameters[0] = new Vector3D(x1, y1, z1);        lineModel.addPoint(pointParameters, lineModel.CORNER);        pointParameters = new Vector3D[1];        pointParameters[0] = new Vector3D(x2, y2, z2);        lineModel.addPoint(pointParameters, lineModel.CORNER);        return lineModel;    }    /**    This method implements the example presented in section [MANT1988].12.2,    and program [MANT1988].12.1.    Generate an arc based on the radius and the coordinates of the center on    the plane z=h. This method assumes that the first vertex of the arc    already exists, so its identifier (vertexId) must be supplied.    This method generates an approximation of a circular arc segment with    `n` edges, centered at <cx, cy, h>, on the plane z=h, and with radius    `rad`. The arc ranges from angle `phi1` to `phi2`, measured in degrees,    where an angle of 0.0 degrees equals the x-axis and angles grow    counterclockwise. The arc starts from existing vertex `vertexId` of face    `faceId`.    */    public static void addArc(PolyhedralBoundedSolid solid,        int faceId, int vertexId,        double cx, double cy, double rad, double h, double phi1, double phi2,        int n)    {        double x, y, angle, inc;        int prev, i, nextVertexId;        angle = Math.toRadians(phi1);        inc = Math.toRadians(((phi2 - phi1) / ((double)n)));        prev = vertexId;        for ( i = 0; i < n; i++ ) {            angle += inc;            x = cx + rad * Math.cos(angle);            y = cy + rad * Math.sin(angle);            nextVertexId = solid.getMaxVertexId() + 1;            solid.smev(faceId, prev, nextVertexId, new Vector3D(x, y, h));            prev = nextVertexId;        }        solid.validateModel();    }    /**    This method implements the example presented in section [MANT1988].12.2,    and program [MANT1988].12.2.    */    public static PolyhedralBoundedSolid createCircularLamina(        double cx, double cy, double rad, double h, int n)    {        PolyhedralBoundedSolid solid;        solid = new PolyhedralBoundedSolid();        solid.mvfs(new Vector3D(cx + rad, cy, h), 1, 1);        addArc(solid, 1, 1, cx, cy, rad, h, 0,             ((double)(n-1))*360.0/((double)n), n-1);        solid.smef(1, n, 1, 2);        solid.validateModel();        return solid;    }    /**    This method implements a generalized/extended version of the example    presented in section [MANT1988].12.3.1, and figure [MANT1988].12.3. In the    original example, a displacement vector is added (translated) to    the extruded point. Current implementation allows translations, scales    and rotations in terms of original face plane.    PRE: Given face should be closed and planar ("well formed")    Note that current algorithm could work on a lamina, on or an "ending face",    permiting a solid modeler to build complex loft-type sweeps based on    current method.    */    public static void translationalSweepExtrudeFace(        PolyhedralBoundedSolid solid,        _PolyhedralBoundedSolidFace face,        Matrix4x4 T)    {        _PolyhedralBoundedSolidLoop l;        _PolyhedralBoundedSolidHalfEdge first, scan;        _PolyhedralBoundedSolidVertex v;        Vector3D newPos;        int i;        for ( i = 0; i < face.boundariesList.size(); i++ ) {            l = face.boundariesList.get(i);            first = l.boundaryStartHalfEdge;            scan = first.next();            v = scan.startingVertex;            newPos = T.multiply(v.position);            solid.lmev(scan, scan, solid.getMaxVertexId()+1, newPos);            while ( scan != first ) {                v = scan.next().startingVertex;                newPos = T.multiply(v.position);                solid.lmev(scan.next(), scan.next(),                     solid.getMaxVertexId()+1, newPos);                solid.lmef(scan.previous(), scan.next().next(),                    solid.getMaxFaceId()+1);                scan = (scan.next().mirrorHalfEdge()).next();            }            solid.lmef(scan.previous(), scan.next().next(),                solid.getMaxFaceId()+1);        }        solid.validateModel();    }    /**    This method implements a generalized/extended version of the     translationalSweepExtrudeFace, which makes the same, plus a second    pass verifying if each of the newly created faces are planar or not.    If a new face is not planar, the face is triangulated.    */    public static void translationalSweepExtrudeFacePlanar(        PolyhedralBoundedSolid solid,        _PolyhedralBoundedSolidFace face,        Matrix4x4 T)    {        _PolyhedralBoundedSolidLoop l;        _PolyhedralBoundedSolidHalfEdge first, scan;        _PolyhedralBoundedSolidVertex v;        Vector3D newPos;        ArrayList<Integer> newfaces = new ArrayList<Integer>();        int i;        int newfaceid;        for ( i = 0; i < face.boundariesList.size(); i++ ) {            l = face.boundariesList.get(i);            first = l.boundaryStartHalfEdge;            scan = first.next();            v = scan.startingVertex;            newPos = T.multiply(v.position);            solid.lmev(scan, scan, solid.getMaxVertexId()+1, newPos);            while ( scan != first ) {                v = scan.next().startingVertex;                newPos = T.multiply(v.position);                solid.lmev(scan.next(), scan.next(),                     solid.getMaxVertexId()+1, newPos);                newfaceid = solid.getMaxFaceId()+1;                solid.lmef(scan.previous(), scan.next().next(), newfaceid);                newfaces.add(new Integer(newfaceid));                scan = (scan.next().mirrorHalfEdge()).next();            }            newfaceid = solid.getMaxFaceId()+1;            solid.lmef(scan.previous(), scan.next().next(), newfaceid);            newfaces.add(new Integer(newfaceid));        }        _PolyhedralBoundedSolidFace newface;        for ( i = 0; i < newfaces.size(); i++ ) {            newfaceid = newfaces.get(i).intValue();            newface = solid.findFace(newfaceid);            if ( !solid.validateFaceIsPlanar(newface) ) {                scan = newface.boundariesList.get(0).boundaryStartHalfEdge;                newfaceid = solid.getMaxFaceId()+1;                solid.lmef(scan.next(), scan.previous(), newfaceid);            }        }        for ( i = 0; newfaces.size() > 0; i++ ) {            newfaces.remove(0);        }        newfaces = null;        solid.validateModel();    }    public static PolyhedralBoundedSolid createBrepFromParametricCurve(ParametricCurve curve)    {        //-----------------------------------------------------------------        int i, j;        int totalNumberOfPoints;        double list[][];        Vector3D first;        boolean beginning;        int count;        //-----------------------------------------------------------------        totalNumberOfPoints = 0;        for ( i = 1; i < curve.types.size(); i++ ) {            if ( curve.types.get(i).intValue() == curve.BREAK ) {                i++;                continue;            }            ArrayList polyline = curve.calculatePoints(i, false);            totalNumberOfPoints += polyline.size();        }        list = new double[totalNumberOfPoints][3];        //-----------------------------------------------------------------        PolyhedralBoundedSolid solid;        boolean firstLoop = true;        int nextVertexId = 1;        int lastLoopStartVertexId = 1;        count = 0;        boolean needAnEnding = false;        int nextFaceId = 1;        solid = new PolyhedralBoundedSolid();        first = new Vector3D();        beginning = true;        for ( i = 1; i < curve.types.size(); i++ ) {            if ( curve.types.get(i).intValue() == curve.BREAK ) {                i++;                //----------                solid.mef(1, 1,                          lastLoopStartVertexId, lastLoopStartVertexId+1,                           nextVertexId-1, nextVertexId-2, nextFaceId);                nextFaceId++;                if ( !firstLoop ) {                    solid.kfmrh(2, nextFaceId-1);                }                //----------                firstLoop = false;                beginning = true;                continue;            }            // Build a polyline for approximating the [i] curve segment            ArrayList polyline = curve.calculatePoints(i, false);            // Insert into current contour the polyline            for ( j = 0; j < polyline.size(); j++ ) {                Vector3D vec = (Vector3D)polyline.get(j);                if ( !beginning ) {                    Vector3D prev = new Vector3D(list[count-1][0],                                                  list[count-1][1],                                                 list[count-1][2]);                    if ( VSDK.vectorDistance(vec,  prev) > VSDK.EPSILON &&                         VSDK.vectorDistance(vec, first) > VSDK.EPSILON ) {                        list[count][0] = vec.x;                        list[count][1] = vec.y;                        list[count][2] = vec.z;                        solid.smev(1, nextVertexId-1, nextVertexId, new Vector3D(vec));                        nextVertexId++;                        count++;                    }                  }                  else {                    beginning = false;                    list[count][0] = vec.x;                    list[count][1] = vec.y;                    list[count][2] = vec.z;                    if ( firstLoop ) {                        solid.mvfs(new Vector3D(vec), nextVertexId, nextFaceId);                        nextVertexId++;                        nextFaceId++;                    }                    else {                        solid.smev(1, nextVertexId-1, nextVertexId, new Vector3D(vec));                        nextVertexId++;                        solid.kemr(1, 1, nextVertexId-2, nextVertexId-1,                            nextVertexId-1, nextVertexId-2);                        lastLoopStartVertexId = nextVertexId-1;                        needAnEnding = true;                    }                    first = new Vector3D(vec.x, vec.y, vec.z);                    count++;                }            }        }        solid.mef(1, 1,                  lastLoopStartVertexId, lastLoopStartVertexId+1,                   nextVertexId-1, nextVertexId-2, nextFaceId);        nextFaceId++;        if ( needAnEnding ) {            solid.kfmrh(2, nextFaceId-1);        }        solid.validateModel();        return solid;    }    /**    Given the input `inSolid` and the cutting plane `inSplittingPlane`,    this method appends to the `outSolidsAbove` list the solids resulting    from cutting the solid with the plane and resulting above the plane,    similarly, `outSolidsBelow` will be appended with solid pieces    resulting below the plane.    This is just a placeholder for method PolyhedralBoundedSolidSplitter.split.    Check its documentation for extra information.    */    public static void split(                      PolyhedralBoundedSolid inSolid,                      InfinitePlane inSplittingPlane,                      ArrayList<PolyhedralBoundedSolid> outSolidsAbove,                      ArrayList<PolyhedralBoundedSolid> outSolidsBelow)    {        PolyhedralBoundedSolidSplitter.split(inSolid, inSplittingPlane,                                             outSolidsAbove, outSolidsBelow);    }    /**    This is just a placeholder for method        PolyhedralBoundedSolidSetOperator.setOp.    Check its documentation for extra information.    */    public static PolyhedralBoundedSolid setOp(        PolyhedralBoundedSolid inSolidA,        PolyhedralBoundedSolid inSolidB,        int op)    {        return PolyhedralBoundedSolidSetOperator.setOp(inSolidA, inSolidB, op);    }}//===========================================================================//= EOF                                                                     =//===========================================================================

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品电影一区二区三区| 国产精品综合av一区二区国产馆| 亚洲v精品v日韩v欧美v专区| 精品在线亚洲视频| 91久久精品国产91性色tv| 欧美不卡一区二区三区| 亚洲另类中文字| 国产精品一区二区三区四区| 777xxx欧美| 免费在线观看视频一区| 91搞黄在线观看| 国产精品大尺度| 国产自产2019最新不卡| 欧美日韩精品是欧美日韩精品| 国产女人18毛片水真多成人如厕 | 麻豆极品一区二区三区| 在线视频一区二区三| 国产清纯白嫩初高生在线观看91 | av在线免费不卡| 久久亚洲一级片| 久久精品久久久精品美女| 色综合久久久久综合| 国产精品美女久久久久久2018| 久久av中文字幕片| 日韩天堂在线观看| 无码av免费一区二区三区试看| 色婷婷综合久久久久中文一区二区 | 99国产精品国产精品久久| 精品国产三级电影在线观看| 日本欧美一区二区| 8v天堂国产在线一区二区| 亚洲第一会所有码转帖| 日本乱码高清不卡字幕| 亚洲美女少妇撒尿| 91亚洲精品一区二区乱码| 国产女主播一区| 国产成人精品影院| 国产精品美日韩| 不卡av在线免费观看| 综合久久综合久久| 91免费精品国自产拍在线不卡 | 久久久蜜臀国产一区二区| 激情综合色丁香一区二区| 久久伊人蜜桃av一区二区| 国产专区综合网| 国产精品久线观看视频| 国产suv精品一区二区6| 国产精品美女久久久久av爽李琼| 不卡电影一区二区三区| 亚洲综合色噜噜狠狠| 日韩精品一区二区三区四区视频 | 亚洲综合免费观看高清完整版 | 欧美性大战久久| 亚洲国产日产av| 精品国产亚洲在线| 成人久久视频在线观看| 一区二区三区毛片| 日韩午夜激情视频| 国产成人啪免费观看软件| 一区视频在线播放| 欧美日本在线观看| 久久不见久久见免费视频1| 久久精品视频一区二区| av在线不卡电影| 午夜精品视频在线观看| 精品国产一区二区三区忘忧草 | 一色桃子久久精品亚洲| 欧美丝袜丝交足nylons| 麻豆国产精品一区二区三区 | 中文字幕+乱码+中文字幕一区| 欧美va亚洲va| 色视频一区二区| 精品久久久网站| 综合久久给合久久狠狠狠97色| 亚洲午夜激情av| 波多野结衣91| 精品国产免费一区二区三区四区| 亚洲图片另类小说| 国产一区二区三区四区在线观看| 99精品国产视频| 中文字幕精品一区二区精品绿巨人| 亚洲国产精品一区二区www在线| 26uuu精品一区二区在线观看| 91免费视频大全| 国产乱码精品一区二区三| 亚洲国产精品嫩草影院| 国产精品色一区二区三区| 69p69国产精品| 91丨九色丨黑人外教| 国产麻豆精品95视频| 日韩成人一级片| 一区二区三区四区激情| 中文一区二区在线观看| 日韩情涩欧美日韩视频| 在线观看日韩电影| av不卡在线观看| 国产乱码精品一品二品| 日av在线不卡| 亚洲va在线va天堂| 亚洲欧美日韩精品久久久久| 国产农村妇女精品| 精品毛片乱码1区2区3区| 7777精品伊人久久久大香线蕉完整版 | 国产在线视频一区二区| 亚洲图片有声小说| 国产精品另类一区| 欧美sm美女调教| 宅男在线国产精品| 欧美日韩精品一区二区在线播放 | 一区二区成人在线观看| 国产精品久久久久久久久免费相片| www国产精品av| 精品日韩av一区二区| 欧美大尺度电影在线| 91精品国产综合久久小美女| 56国语精品自产拍在线观看| 欧美久久一区二区| 欧美日韩在线电影| 69精品人人人人| 日韩午夜三级在线| 久久久久久久久蜜桃| 国产午夜精品福利| 国产欧美一区二区在线| 欧美国产日韩一二三区| 国产精品成人网| 亚洲欧美在线aaa| 亚洲视频免费在线观看| 夜夜嗨av一区二区三区网页| 婷婷综合久久一区二区三区| 免费高清在线一区| 国产一区二区三区免费| 国产91在线观看丝袜| 北条麻妃一区二区三区| 91麻豆国产精品久久| 欧美视频中文字幕| 日韩视频免费观看高清在线视频| 2020国产精品自拍| 中文字幕欧美三区| 亚洲一区二区三区四区不卡| 青椒成人免费视频| 国产精品一区三区| 色综合欧美在线| 日韩欧美在线综合网| 国产性做久久久久久| 亚洲视频一区二区在线| 午夜天堂影视香蕉久久| 国产综合久久久久影院| 一本一本久久a久久精品综合麻豆| 欧美美女视频在线观看| 久久一日本道色综合| 国产精品久久久爽爽爽麻豆色哟哟| 怡红院av一区二区三区| 精品中文字幕一区二区小辣椒| av亚洲产国偷v产偷v自拍| 欧美丝袜自拍制服另类| 久久综合五月天婷婷伊人| 亚洲欧美一区二区三区孕妇| 日本在线不卡一区| jvid福利写真一区二区三区| 91精品国产麻豆国产自产在线| 国产精品色婷婷| 日本视频在线一区| 99久久综合精品| 日韩一区二区中文字幕| 日韩毛片高清在线播放| 久草这里只有精品视频| 色又黄又爽网站www久久| 欧美r级在线观看| 亚洲一区二区三区四区在线| 国产成人av一区| 日韩一区二区在线观看视频播放| 亚洲素人一区二区| 狠狠色丁香久久婷婷综| 欧美亚洲动漫精品| 国产精品成人网| 国产一区二区精品久久| 51精品秘密在线观看| 国产精品色哟哟| 国产一区激情在线| 欧美久久久一区| 亚洲激情网站免费观看| 成人免费av在线| 国产亚洲综合在线| 青青草国产精品97视觉盛宴| 欧美日韩午夜在线| 亚洲精品成人a在线观看| 成人午夜视频在线观看| 日韩一级大片在线| 日本v片在线高清不卡在线观看| 色噜噜狠狠一区二区三区果冻| 中文字幕免费在线观看视频一区| 狠狠色狠狠色综合| 日韩精品资源二区在线| 日本伊人午夜精品| 欧美日韩一区二区三区免费看| 尤物在线观看一区| 91久久香蕉国产日韩欧美9色| 18欧美亚洲精品| jlzzjlzz欧美大全| 亚洲欧洲av色图|