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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? polyhedralboundedsolidsplitter.java

?? 基于java的3d開發(fā)庫。對坐java3d的朋友有很大的幫助。
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
//===========================================================================//=-------------------------------------------------------------------------=//= Module history:                                                         =//= - March 26 2008 - Oscar Chavarro: Original base version                 =//=-------------------------------------------------------------------------=//= References:                                                             =//= [MANT1988] Mantyla Martti. "An Introduction To Solid Modeling",         =//=     Computer Science Press, 1988.                                       =//===========================================================================package vsdk.toolkit.processing;// Java classesimport java.util.ArrayList;import java.util.Collections;// VitralSDK classesimport vsdk.toolkit.common.VSDK;import vsdk.toolkit.common.Vector3D;import vsdk.toolkit.common.CircularDoubleLinkedList;import vsdk.toolkit.environment.geometry.Geometry;import vsdk.toolkit.environment.geometry.InfinitePlane;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._PolyhedralBoundedSolidEdge;import vsdk.toolkit.environment.geometry.polyhedralBoundedSolidNodes._PolyhedralBoundedSolidHalfEdge;import vsdk.toolkit.environment.geometry.polyhedralBoundedSolidNodes._PolyhedralBoundedSolidVertex;/**This class is used to store vertex / halfedge neigborhood information, as presentedin section [MANT1988].14.5, and program [MANT1988].14.3.*/class _PolyhedralBoundedSolidSplitterSectorClassification extends PolyhedralBoundedSolidOperator{    public static final int ABOVE = 1;    public static final int BELOW = -1;    public static final int ON = 0;    public static final int COPLANAR_FACE = 10;    public static final int INPLANE_EDGE = 20;    public static final int CROSSING_EDGE = 30;    public static final int UNDEFINED = 40;    public _PolyhedralBoundedSolidHalfEdge sector;    public int cl;    // Following attributes are not taken from [MANT1988], and all operations    // on them are fine tunning options aditional to original algorithm.    public boolean isWide = false;    public Vector3D position;    public int situation = UNDEFINED;    public String toString()    {        String msg = "{";        msg = msg + sector;        switch ( cl ) {          case ABOVE: msg = msg + " ABOVE"; break;          case BELOW: msg = msg + " BELOW"; break;          case ON: msg = msg + " ON"; break;          default: msg = msg + "<INVALID!>"; break;        }        if ( isWide ) {            msg = msg + " (W) ";        }        //msg = msg + ", pos: " + position;        switch ( situation ) {          case COPLANAR_FACE: msg = msg + "<COPLANAR_FACE>"; break;          case INPLANE_EDGE: msg = msg + "<INPLANE_EDGE>"; break;          case CROSSING_EDGE: msg = msg + "<CROSSING_EDGE>"; break;          default: msg = msg + "<UNDEFINED>"; break;        }        msg = msg + "}";        return msg;    }}/**Class `_PolyhedralBoundedSolidSplitterNullEdge` plays a role of a decoratordesign patern for class `_PolyhedralBoundedSolidEdge`, and adds sort-ability.*/class _PolyhedralBoundedSolidSplitterNullEdge extends PolyhedralBoundedSolidOperator implements Comparable <_PolyhedralBoundedSolidSplitterNullEdge>{    public _PolyhedralBoundedSolidEdge e;    public _PolyhedralBoundedSolidSplitterNullEdge(_PolyhedralBoundedSolidEdge e)    {        this.e = e;    }    public int compareTo(_PolyhedralBoundedSolidSplitterNullEdge other)    {        Vector3D a;        Vector3D b;        a = this.e.rightHalf.startingVertex.position;        b = other.e.rightHalf.startingVertex.position;        if ( PolyhedralBoundedSolid.compareValue(a.x, b.x, 10*VSDK.EPSILON) != 0 ) {            if ( a.x < b.x ) {                return -1;            }            return 1;        }        else {            if ( PolyhedralBoundedSolid.compareValue(a.y, b.y, 10*VSDK.EPSILON) != 0 ) {                if ( a.y < b.y ) {                    return -1;                }                return 1;            }            else {                if ( a.z < b.z ) {                    return -1;                }                return 1;            }        }    }}/**This is a utility class containing operations for implementing the boundaryrepresentation split methods over winged-edge data structures, as presentedat chapter [MANT1988].14.This class offers just one public method, which is supposed to be calledfrom GeometricModeler class.*/public class PolyhedralBoundedSolidSplitter extends PolyhedralBoundedSolidOperator{    /**    Following variable `soov` ("set of ON-vertices") from program [MANT1988].14.1.    */    private static ArrayList<_PolyhedralBoundedSolidVertex> soov;    /**    Following variable `sone` ("set of null edges") from program [MANT1988].14.1.    */    private static ArrayList<_PolyhedralBoundedSolidSplitterNullEdge> sone;    /**    Following variable `sonf` ("set of null faces") from program [MANT1988].14.1.    */    private static ArrayList<_PolyhedralBoundedSolidFace> sonf;    private static ArrayList<_PolyhedralBoundedSolidFace> facesToFixAbove;    private static ArrayList<_PolyhedralBoundedSolidFace> facesToFixBelow;    /**    Following variable `ends` from program [MANT1988].14.9.    */    private static ArrayList<_PolyhedralBoundedSolidHalfEdge> ends;    private static ArrayList<_PolyhedralBoundedSolidHalfEdge> tieds;    /**    Implements function `addsoov` from section [MANT1988].14.4. and program    [MANT1988].14.2.    */    private static void addsoov(_PolyhedralBoundedSolidVertex v)    {        int i;        for ( i = 0; i < soov.size(); i++ ) {            if ( soov.get(i) == v ) {                return;            }        }        soov.add(v);    }    /**    Implements solid splitting reduction step as indicated on sections    [MANT1988].14.2.1 and [MANT1988].14.4 and program [MANT1988].14.2.    This method is responsible for generating the set of coplanar    vertices of `inSolid` (with respect to `inSplittingPlane`) and store    them on `soov` for later usage.    This method subdivides all edges of `inSolid` that intersects    `inSplittingPlane` at their intersection points.    */    private static void splitGenerate(PolyhedralBoundedSolid inSolid,                                      InfinitePlane inSplittingPlane)    {        _PolyhedralBoundedSolidEdge e;        _PolyhedralBoundedSolidHalfEdge he;        _PolyhedralBoundedSolidVertex v1, v2;        Vector3D p;        double d1, d2, t;        int s1, s2;        int i;        soov = new ArrayList<_PolyhedralBoundedSolidVertex>();        for ( i = 0; i < inSolid.edgesList.size(); i++ ) {            e = inSolid.edgesList.get(i);            v1 = e.rightHalf.startingVertex;            v2 = e.leftHalf.startingVertex;            d1 = inSplittingPlane.pointDistance(v1.position);            d2 = inSplittingPlane.pointDistance(v2.position);            s1 = inSolid.compareValue(d1, 0.0, VSDK.EPSILON);            s2 = inSolid.compareValue(d2, 0.0, VSDK.EPSILON);            if ( (s1 == -1 && s2 == 1) || (s1 == 1 && s2 == -1) ) {                t = d1 / (d1 - d2);                p = v1.position.add((v2.position.substract(v1.position)).multiply(t));                he = e.leftHalf.next();                inSolid.lmev(e.rightHalf, he, inSolid.getMaxVertexId()+1, p);                addsoov(he.previous().startingVertex);            }            else {                if ( s1 == 0 ) {                    addsoov(v1);                }                if ( s2 == 0 ) {                    addsoov(v2);                }            }        }        /*        System.out.println("-----");        for ( i = 0; i < soov.size(); i++ ) {            System.out.println("  - Vertex [" + i + "]: " + soov.get(i));        }        System.out.println("-----");        */    }    /**    Current method is the first step for the initial classification of vertex    neighborhood for `vtx`, as indicated on section [MANT1988].14.5.2. and    program [MANT1988].14.4.    Vitral SDK's implementation of this procedure extends the original from    [MANT1988] by adding extra information flags to sector classifications    `.isWide`, `.position` and `.situation`. Those flags are an additional    aid for debugging purposes and specifically the `situation` flag will be    later used on `splitClassify` to correct the ordering of sectors in order    to keep consistency with Vitral SDK's interpretation of coordinate system.    */    private static ArrayList<_PolyhedralBoundedSolidSplitterSectorClassification> getNeighborhood(_PolyhedralBoundedSolidVertex vtx, InfinitePlane inSplittingPlane)    {        _PolyhedralBoundedSolidHalfEdge he;        Vector3D bisect;        double d;        _PolyhedralBoundedSolidSplitterSectorClassification c;        ArrayList<_PolyhedralBoundedSolidSplitterSectorClassification> neighborSectorsInfo;        neighborSectorsInfo = new ArrayList<_PolyhedralBoundedSolidSplitterSectorClassification>();        he = vtx.emanatingHalfEdge;        do {            c = new _PolyhedralBoundedSolidSplitterSectorClassification();            c.sector = he;            d = inSplittingPlane.pointDistance((he.next()).startingVertex.position);            c.cl = PolyhedralBoundedSolid.compareValue(d, 0.0, VSDK.EPSILON);            c.isWide = false;            c.position = new Vector3D((he.next()).startingVertex.position);            c.situation = c.UNDEFINED;            neighborSectorsInfo.add(c);            if ( checkWideness(he) ) {                bisect = bisector(he);                c.situation = c.CROSSING_EDGE;                c = new _PolyhedralBoundedSolidSplitterSectorClassification();                c.sector = he;                d = inSplittingPlane.pointDistance(bisect);                c.cl = PolyhedralBoundedSolid.compareValue(d, 0.0, VSDK.EPSILON);                c.isWide = true;                c.position = new Vector3D(bisect);                c.situation = c.CROSSING_EDGE;                neighborSectorsInfo.add(c);            }            he = (he.mirrorHalfEdge()).next();        } while ( he != vtx.emanatingHalfEdge );        //-----------------------------------------------------------------        // Extra pass, not from original [MANT1988] code        int i;        for ( i = 0; i < neighborSectorsInfo.size(); i++ ) {            c = neighborSectorsInfo.get(i);            if ( c.cl == c.ON && c.situation == c.UNDEFINED ) {                c.situation = c.INPLANE_EDGE;            }        }        return neighborSectorsInfo;    }    private static boolean inplaneEdgesOn(        ArrayList<_PolyhedralBoundedSolidSplitterSectorClassification> nbr)    {        int i;        for ( i = 0; i < nbr.size(); i++ ) {            if ( nbr.get(i).situation == nbr.get(i).INPLANE_EDGE ) return true;        }        return false;    }    /**    Current method applies the first reclassification rule presented at    sections [MANT1988].14.5.1 and [MANT1988].14.5.2:    For the given vertex neigborhood, classify each edge according to whether    its final vertex lies above, on or below the `inSplittingPlane`. Tag    the edge with the corresponding label ABOVE, ON or BELOW.    Following program [MANT1988].14.5.    */    private static void reclassifyOnSectors(        ArrayList<_PolyhedralBoundedSolidSplitterSectorClassification> nbr,        InfinitePlane inSplittingPlane)    {        _PolyhedralBoundedSolidFace f;        Vector3D c;        double d;        int i;        _PolyhedralBoundedSolidSplitterSectorClassification l;        for ( i = 0; i < nbr.size(); i++ ) {            l = nbr.get(i);            f = l.sector.parentLoop.parentFace;            c = f.containingPlane.getNormal().crossProduct(inSplittingPlane.getNormal());            d = c.dotProduct(c);            if ( PolyhedralBoundedSolid.compareValue(d, 0.0, VSDK.EPSILON) == 0 ) {                // Entering this means "faces are coplanar"                d = f.containingPlane.getNormal().dotProduct(inSplittingPlane.getNormal());                if ( PolyhedralBoundedSolid.compareValue(d, 0.0, VSDK.EPSILON) == 1 ) {                    l.cl = l.BELOW;                    l.situation = l.COPLANAR_FACE;                    nbr.get((i+1)%nbr.size()).cl = l.BELOW;                }                else {                    l.cl = l.ABOVE;                    l.situation = l.COPLANAR_FACE;                    nbr.get((i+1)%nbr.size()).cl = l.ABOVE;                }            }        }    }    /**    Current method applies the second reclassification rule presented at    sections [MANT1988].14.5.1 and [MANT1988].14.5.2:    After applying the first rule on method `reclassifyOnSectors`, ON edges    may appear in only four kinds of consecutive arrangements. For each    of the following arrangements, ON edge is reclassified as ABOVE or BELOW:      - Sequence ABOVE/ON/ABOVE -> reclassified as BELOW      - Sequence ABOVE/ON/BELOW -> reclassified as BELOW      - Sequence BELOW/ON/BELOW -> reclassified as ABOVE      - Sequence BELOW/ON/ABOVE -> reclassified as BELOW    Those 4 rules are designed so that nonmanifold results will be represented    as disconnected models.    Following program [MANT1988].14.6.    */    private static void reclassifyOnEdges(ArrayList<_PolyhedralBoundedSolidSplitterSectorClassification> nbr)    {        _PolyhedralBoundedSolidSplitterSectorClassification l;        int i;        for ( i = 0; i < nbr.size(); i++ ) {            l = nbr.get(i);            if ( l.cl == l.ON ) {                if ( nbr.get((nbr.size()+i-1) % nbr.size()).cl == l.BELOW ) {                    if ( nbr.get((i+1) % nbr.size()).cl == l.BELOW ) {                        nbr.get(i).cl = l.ABOVE;                    }                    else {                        nbr.get(i).cl = l.BELOW;                    }                }                else {                    nbr.get(i).cl = l.BELOW;                }            }        }    }    /**    Following section [MANT1988].14,6,2 and program [MANT1988].14.7.    Note, this code is horrible! YUCK! :P    With respect to the original algorithm from [MANT1988], current    implementation adds an extra check to ensure the orientation of the    edges from below to above.    */    private static void insertNullEdges(

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲福利视频三区| 久久久99久久| av中文字幕在线不卡| 裸体在线国模精品偷拍| 日韩电影一二三区| 蜜桃av一区二区| 精品亚洲国产成人av制服丝袜| 亚瑟在线精品视频| 日韩精品一二三| 麻豆91免费观看| 国产精品一区在线| av电影一区二区| 色噜噜夜夜夜综合网| 欧美日韩一区成人| 91精品啪在线观看国产60岁| 日韩欧美一级二级三级久久久| 欧美一区二区在线免费观看| 精品国产乱码久久久久久久久| 久久综合色播五月| 国产精品高潮呻吟| 亚洲综合男人的天堂| 日韩电影网1区2区| 国产精品一二二区| 色婷婷精品大在线视频| 欧美日韩第一区日日骚| 精品国一区二区三区| 欧美国产在线观看| 五月激情综合婷婷| 国产成人亚洲综合色影视| jvid福利写真一区二区三区| 欧洲人成人精品| 精品成人免费观看| 亚洲精选免费视频| 久久99日本精品| 色综合久久久久网| 欧美岛国在线观看| 亚洲日穴在线视频| 国产综合一区二区| 在线观看91视频| 中文字幕乱码一区二区免费| 香蕉久久夜色精品国产使用方法| 国产精华液一区二区三区| 在线免费视频一区二区| 久久久九九九九| 日韩国产在线观看| 一本色道久久综合亚洲91| 日韩欧美高清一区| 天天综合日日夜夜精品| 成人久久久精品乱码一区二区三区| 欧美四级电影在线观看| 亚洲国产成人在线| 国产在线观看免费一区| 欧美日韩在线观看一区二区| 国产精品视频yy9299一区| 美国毛片一区二区三区| 欧美日韩国产123区| 亚洲免费资源在线播放| 国产成人精品一区二| 日韩精品专区在线影院观看| 亚洲综合男人的天堂| 色综合久久久久久久久| 中文字幕中文字幕在线一区| 国产一区二区精品久久91| 日韩欧美一级二级| 老司机一区二区| 91精品免费在线观看| 日韩精品免费专区| 精品视频免费在线| 午夜精品爽啪视频| 精品视频一区三区九区| 亚洲一卡二卡三卡四卡| 欧美又粗又大又爽| 亚洲影院理伦片| 欧美日韩国产123区| 亚洲成av人影院| 91精品国产综合久久久久久久久久 | 亚洲最大的成人av| 99久久夜色精品国产网站| 国产精品嫩草影院av蜜臀| 国产黄人亚洲片| 中文字幕av一区二区三区高| 福利一区二区在线观看| 国产精品萝li| 91久久国产最好的精华液| 亚洲国产精品视频| 欧美肥大bbwbbw高潮| 蜜臀91精品一区二区三区| 欧美不卡一区二区三区| 国产真实乱偷精品视频免| 国产日韩欧美精品综合| av在线综合网| 亚洲国产sm捆绑调教视频 | 精品欧美一区二区在线观看| 久久国产剧场电影| 久久久久久久性| 91在线观看下载| 亚洲国产精品自拍| 亚洲精品在线免费观看视频| 国产成人欧美日韩在线电影| 综合久久久久久| 欧美日韩视频专区在线播放| 蜜桃在线一区二区三区| 中文一区一区三区高中清不卡| 色综合天天综合狠狠| 亚洲成人动漫av| 国产亚洲短视频| 在线观看www91| 国产乱一区二区| 亚洲综合色自拍一区| 欧美成人官网二区| 99久久精品国产一区| 日本在线不卡视频一二三区| 欧美激情一区三区| 欧美美女一区二区在线观看| 国产麻豆精品在线观看| 亚洲福利国产精品| 欧美日韩国产天堂| 国产成人精品亚洲777人妖| 一区二区三区四区五区视频在线观看 | 国产一区久久久| 亚洲午夜激情av| 中文字幕乱码一区二区免费| 欧美男男青年gay1069videost| 成人影视亚洲图片在线| 日本不卡的三区四区五区| 自拍偷拍国产亚洲| 久久综合久色欧美综合狠狠| 欧美卡1卡2卡| 色女孩综合影院| zzijzzij亚洲日本少妇熟睡| 麻豆成人av在线| 日韩vs国产vs欧美| 亚洲精品国产a久久久久久| 国产日产欧美一区| 欧美tk丨vk视频| 日韩一区二区三区三四区视频在线观看| 成人激情视频网站| 极品销魂美女一区二区三区| 天天影视色香欲综合网老头| 伊人一区二区三区| 国产精品久久久久四虎| 国产午夜亚洲精品不卡| 日韩精品一区二区三区中文不卡| 欧美日韩国产综合草草| 欧美亚洲尤物久久| 在线观看视频91| 日本韩国精品在线| 色婷婷综合久久久中文字幕| 91玉足脚交白嫩脚丫在线播放| 成人一级片网址| 波多野结衣的一区二区三区| 国产91精品一区二区麻豆亚洲| 国产一区二区三区四| 激情欧美一区二区| 国产乱人伦偷精品视频不卡 | 国产午夜亚洲精品午夜鲁丝片| 欧美成人午夜电影| 国产亚洲精品bt天堂精选| 久久久久久黄色| 国产精品国产a| 中文字幕日本乱码精品影院| 久久久久久久一区| 国产精品色在线| 亚洲自拍偷拍欧美| 三级成人在线视频| 国内精品免费**视频| 国产成人免费av在线| 成人av午夜电影| 色综合夜色一区| 欧美美女网站色| 久久综合久久综合九色| 中文字幕不卡一区| 午夜欧美在线一二页| 日韩电影在线看| 成人天堂资源www在线| 91视频在线观看免费| 欧美精品 日韩| 久久欧美一区二区| 亚洲精品免费在线观看| 亚洲aaa精品| 成人网页在线观看| 精品视频1区2区| 国产日韩精品一区二区浪潮av| 亚洲丝袜自拍清纯另类| 天堂一区二区在线| 国产99久久久国产精品免费看 | 国产一区视频在线看| 91最新地址在线播放| 欧美高清www午色夜在线视频| 久久色中文字幕| 亚洲一级二级在线| 成人小视频在线| 欧美成人a∨高清免费观看| 亚洲色图一区二区| 精品一区二区三区免费播放| 91福利国产成人精品照片| 欧美成人激情免费网| 亚洲高清免费观看高清完整版在线观看| 久久国产三级精品| 在线观看一区日韩|