Esempio n. 1
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. 2
0
    public static SGBuilding CreateApt(SOPoint sop, Vector3 size)
    {
        SGBuilding building = new SGBuilding();
        Grammar    gp       = new Grammar();

        gp.name = "planing1";
        gp.inputs.shapes.Add(sop);
        gp.AddRule(new Rules.CreateOperableBox("A", new Vector3(30, 30, 20)));
        gp.AddRule(new Rules.SizeBuilding3D("A", "A", new Vector3(30, 20, 15)));
        gp.AddRule(new Rules.ResidentialLoadFilter("A", "IHUS", "DHUS", "A"));
        gp.AddRule(new Rules.ApartmentLoadFilter("A", "SL", "DL", "CV"), false);
        gp.AddRule(new Rules.SingleLoaded("SL", "APT"), false);
        gp.AddRule(new Rules.DoubleLoaded("DL", "APT"), false);
        gp.AddRule(new Rules.CentralVoid("CV", "APT", "APT2"), false);
        building.SetGPlanning(gp);
        building.SetMassing(MassingGrammars.GA());
        //building.SetFacade(FacadeGrammars.CW01());
        building.SetSize(size);
        sop.grammar = gp;
        //sop.onPositionChanged += delegate { building.Execute(); };
        //sop.onDestroy += delegate { building.ClearForDestroy(); };
        return(building);
    }
Esempio n. 3
0
 public void SetMassingC()
 {
     SceneManager.SelectedBuilding.SetMassing(MassingGrammars.GC(), true);
 }