Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        Vector3[]   pts = initShape2();
        ShapeObject so  = ShapeObject.CreateExtrusion(pts, 30);
        Grammar     g1  = new Grammar();

        g1.inputs.shapes.Add(so);
        g1.AddRule(new Rules.Scale3D("A", "A", new Vector3(1, 1, 1)));

        Properties buildingA = new BuildingProperties();

        buildingA.AddGrammar(g1);
    }
Esempio n. 2
0
    void Start()
    {
        Vector3[] pts = new Vector3[5];
        pts[0] = new Vector3(-80, 0, 46);
        pts[1] = new Vector3(-80, 0, -11);
        pts[2] = new Vector3(-10, 0, -54);
        pts[3] = new Vector3(103, 0, 25);
        pts[4] = new Vector3(96, 0, 70);
        pl     = new Polyline(pts);
        Vector3?ld = PointsBase.LongestDirection(pts);

        //passed
        //ShapeObject so = ShapeObject.CreatePolygon(pts);
        ShapeObject so = ShapeObject.CreateExtrusion(pts, 40);
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        Vector3[] pts = new Vector3[]
        {
            new Vector3(),
            new Vector3(35, 0, -4),
            new Vector3(50, 0, 0),
            new Vector3(50, 0, 15),
            new Vector3(0, 0, 15)
        };

        SOPoint    sop = SOPoint.CreatePoint();
        SGBuilding b1  = new SGBuilding();

        ShapeObject so2 = ShapeObject.CreateExtrusion(pts, 30);

        so2.meshable.bbox = BoundingBox.CreateFromPoints(so2.meshable.vertices, new Vector3(1, 0, 0));
        b1.SetGPlanning(G2(so2));
        b1.SetMassing(MassingGrammars.GB());
        b1.SetProgram(ProgramGrammars.APT1());
        b1.SetFacade(FacadeGrammars.CW01());

        SGBuilding b2  = new SGBuilding();
        SOPoint    so3 = SOPoint.CreatePoint(new Vector3(20, 0, 40));

        b2.SetGPlanning(G1(so3, 40, 60));
        b2.SetMassing(MassingGrammars.GA());
        b2.SetProgram(ProgramGrammars.APT1());
        b2.SetFacade(FacadeGrammars.CW01());



        SceneManager.SelectedGrammar  = b2.gPlaning;
        SceneManager.SelectedBuilding = b2;

        b1.MassingMode();
        b2.MassingMode();

        //b1.Execute();
        //b2.Execute();
        b2.UpdateParams();
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        Vector3[] pts = initShape1();
        //ShapeObject site = ShapeObject.CreatePolygon(pts);
        ShapeObject site = ShapeObject.CreateExtrusion(pts, 1);
        Grammar     gs   = JsPollock(site);

        gs.SetSubParamValue(2, "Position", 0.19f);
        gs.SetSubParamValue(4, "Position", 0.14f);
        gs.Execute();

        gs.ExtractParam(2, "Position", "d1");
        gs.ExtractParam(4, "Position", "d2");

        //ShapeObjectM som = ShapeObjectM.CreateSchemeA((CompositMeshable)so.meshable);
        Properties buildingA = new BuildingProperties();

        buildingA.AddGrammar(gs);
        gs.InvalidateBuilding();
    }