コード例 #1
0
        // GROUPER::GENERATE
        public override GameObject generate(bool makeGameObjects, AXParametricObject initiator_po, bool isReplica)
        {
            //if (ArchimatixUtils.doDebug)
            //Debug.Log (parametricObject.Name + " generate +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");


            if (!parametricObject.isActive)
            {
                return(null);
            }



            preGenerate();


            GameObject go = null;

            if (makeGameObjects && !parametricObject.combineMeshes)
            {
                go = ArchimatixUtils.createAXGameObject(parametricObject.Name, parametricObject);
            }


            List <AXMesh> ax_meshes = new List <AXMesh>();


            // BOUNDING

            List <AXMesh> boundingMeshes = new List <AXMesh>();



            // Reinstate the original functionality of the Grouper as simple combiner in addition to Groupees.
            if (inputs != null && inputs.Count > 0)
            {
                // ALL
                if (channel == inputs.Count)
                {
                    for (int i = 0; i < inputs.Count; i++)
                    {
                        if (inputs[i] != null && inputs[i].DependsOn != null)
                        {
                            if (inputs[i].Dependents != null || inputs[i].Dependents.Count == 0)
                            {
                                AXParameter        src_p  = inputs[i].DependsOn;
                                AXParametricObject src_po = inputs[i].DependsOn.parametricObject;
                                //if (! parametricObject.visited_pos.Contains (groupee))

                                //Debug.Log("groupee.generateOutputNow: " + groupee.Name + " isAltered="+groupee.isAltered);
                                if (src_po.isAltered)
                                {
                                    src_po.generateOutputNow(makeGameObjects, initiator_po);
                                    //Debug.Log("XXXXX: " + groupee.Output.meshes.Count);
                                    src_po.isAltered = false;
                                    parametricObject.model.AlteredPOs.Remove(src_po);
                                }

                                if (src_p != null && src_p.meshes != null)
                                {
                                    for (int j = 0; j < src_p.meshes.Count; j++)
                                    {
                                        AXMesh dep_amesh = src_p.meshes [j];
                                        ax_meshes.Add(dep_amesh.Clone(dep_amesh.transMatrix));
                                    }
                                }

                                // BOUNDING MESHES
                                //boundsCombinator[i].mesh      = input_p.DependsOn.parametricObject.boundsMesh;
                                //boundsCombinator[i].transform     = input_p.DependsOn.parametricObject.generator.localMatrixWithAxisRotationAndAlignment;
                                if (src_po.boundsMesh != null)
                                {
                                    boundingMeshes.Add(new AXMesh(src_po.boundsMesh, src_po.generator.localMatrixWithAxisRotationAndAlignment));
                                }



                                // GAME_OBJECTS

                                if (makeGameObjects && !parametricObject.combineMeshes)
                                {
                                    GameObject plugGO = src_po.generator.generate(true, initiator_po, isReplica);
                                    if (plugGO != null)
                                    {
                                        plugGO.transform.parent = go.transform;
                                    }
                                }
                            }
                        }
                    }
                }



                // JUST ONE CHANNEL
                else if (inputs.Count > channel && inputs[channel] != null)
                {
                    AXParameter src_p = inputs[channel].DependsOn;

                    if (src_p != null)
                    {
                        AXParametricObject src_po = src_p.parametricObject;

                        if (src_po.is3D())
                        {
                            if (src_po.Output != null && src_po.Output.meshes != null)
                            {
                                for (int j = 0; j < src_po.Output.meshes.Count; j++)
                                {
                                    AXMesh dep_amesh = src_po.Output.meshes [j];
                                    ax_meshes.Add(dep_amesh.Clone(dep_amesh.transMatrix));
                                }
                            }


                            // BOUNDING MESHES
                            //boundsCombinator[i].mesh      = input_p.DependsOn.parametricObject.boundsMesh;
                            //boundsCombinator[i].transform     = input_p.DependsOn.parametricObject.generator.localMatrixWithAxisRotationAndAlignment;
                            if (src_po.boundsMesh != null)
                            {
                                boundingMeshes.Add(new AXMesh(src_po.boundsMesh, src_po.generator.localMatrixWithAxisRotationAndAlignment));
                            }


                            // GAME_OBJECTS

                            if (makeGameObjects && !parametricObject.combineMeshes)
                            {
                                GameObject plugGO = src_po.generator.generate(true, initiator_po, isReplica);
                                if (plugGO != null)
                                {
                                    plugGO.transform.parent = go.transform;
                                }
                            }
                        }



                        P_Output.meshes = src_p.meshes;
                    }
                }


                // FINISH AX_MESHES


                //Debug.Log("ORG: " + ax_meshes.Count);
                parametricObject.finishMultiAXMeshAndOutput(ax_meshes, isReplica);



                // FINISH BOUNDS

                CombineInstance[] boundsCombinator = new CombineInstance[boundingMeshes.Count];
                for (int bb = 0; bb < boundsCombinator.Length; bb++)
                {
                    boundsCombinator[bb].mesh      = boundingMeshes[bb].mesh;
                    boundsCombinator[bb].transform = boundingMeshes[bb].transMatrix;
                }
                setBoundsWithCombinator(boundsCombinator);


                if (P_BoundsX != null && !P_BoundsX.hasRelations() && !P_BoundsX.hasExpressions())
                {
                    P_BoundsX.FloatVal = parametricObject.bounds.size.x;
                }

                if (P_BoundsY != null && !P_BoundsY.hasRelations() && !P_BoundsY.hasExpressions())
                {
                    P_BoundsY.FloatVal = parametricObject.bounds.size.y;
                }

                if (P_BoundsZ != null && !P_BoundsZ.hasRelations() && !P_BoundsZ.hasExpressions())
                {
                    P_BoundsZ.FloatVal = parametricObject.bounds.size.z;
                }
            }



            // FINISH GAME_OBJECTS

            if (makeGameObjects)
            {
                if (parametricObject.combineMeshes)
                {
                    go = parametricObject.makeGameObjectsFromAXMeshes(ax_meshes, true, false);


                    // COMBINE ALL THE MESHES
                    CombineInstance[] combine = new CombineInstance[ax_meshes.Count];

                    int combineCt = 0;
                    for (int i = 0; i < ax_meshes.Count; i++)
                    {
                        AXMesh _amesh = ax_meshes [i];
                        combine [combineCt].mesh      = _amesh.mesh;
                        combine [combineCt].transform = _amesh.transMatrix;
                        combineCt++;
                    }

                    Mesh combinedMesh = new Mesh();
                    combinedMesh.CombineMeshes(combine);

                    // If combine, use combined mesh as invisible collider
                    MeshFilter mf = (MeshFilter)go.GetComponent(typeof(MeshFilter));

                    if (mf == null)
                    {
                        mf = (MeshFilter)go.AddComponent(typeof(MeshFilter));
                    }

                    if (mf != null)
                    {
                        mf.sharedMesh = combinedMesh;
                        parametricObject.addCollider(go);
                    }
                }

                else
                {
                    Matrix4x4 tmx = parametricObject.getLocalMatrix();

                    go.transform.rotation   = AXUtilities.QuaternionFromMatrix(tmx);
                    go.transform.position   = AXUtilities.GetPosition(tmx);
                    go.transform.localScale = parametricObject.getLocalScaleAxisRotated();
                }
                return(go);
            }



            return(null);
        }
コード例 #2
0
        // GROUPER::GENERATE
        public override GameObject generate(bool makeGameObjects, AXParametricObject initiator_po, bool isReplica)
        {
            //if (ArchimatixUtils.doDebug)
            //Debug.Log (parametricObject.Name + " generate +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");

            if (!parametricObject.isActive)
            {
                return(null);
            }

            if (parametricObject.Groupees == null)
            {
                return(null);
            }


            preGenerate();


            parametricObject.useMeshInputs = true;

            if (parametricObject.meshInputs == null)
            {
                parametricObject.meshInputs = new List <AXParameter>();
            }


            // PROCESS INPUT SHAPES

            // pass Input Shape through...


            //Debug.Log( parametricObject.Name + " <><><><><> PROCESS INPUT SHAPES");
            List <AXParameter> inputShapes = parametricObject.getAllInputShapes();

            for (int i = 0; i < inputShapes.Count; i++)
            {
                AXParameter inputShape = inputShapes[i];

                if (inputShape != null)
                {
                    inputShape.polyTree = null;
                    AXShape.thickenAndOffset(ref inputShape, inputShape.DependsOn);
                }
            }



            GameObject go = null;

            if (makeGameObjects && !parametricObject.combineMeshes)
            {
                go = ArchimatixUtils.createAXGameObject(parametricObject.Name, parametricObject);
            }

            List <AXMesh> ax_meshes = new List <AXMesh>();


            List <AXMesh> boundingMeshes = new List <AXMesh>();

            // for each input


            //List<AXParameter> inputMeshes = parametricObject.getAllInputMeshParameters();



            // Reinstate the original functionality of the Grouper as simple combiner in addition to Groupees.
            if (inputs != null && inputs.Count > 0)
            {
                for (int i = 0; i < inputs.Count; i++)
                {
                    if (inputs[i] != null && inputs[i].DependsOn != null)
                    {
                        if (inputs[i].Dependents != null || inputs[i].Dependents.Count == 0)
                        {
                            AXParameter        src_p  = inputs[i].DependsOn;
                            AXParametricObject src_po = inputs[i].DependsOn.parametricObject;
                            //if (! parametricObject.visited_pos.Contains (groupee))

                            //Debug.Log("groupee.generateOutputNow: " + groupee.Name + " isAltered="+groupee.isAltered);
                            if (src_po.isAltered)
                            {
                                src_po.generateOutputNow(makeGameObjects, initiator_po);
                                //Debug.Log("XXXXX: " + groupee.Output.meshes.Count);
                                src_po.isAltered = false;
                                parametricObject.model.AlteredPOs.Remove(src_po);
                            }

                            if (src_p != null && src_p.meshes != null)
                            {
                                for (int j = 0; j < src_p.meshes.Count; j++)
                                {
                                    AXMesh dep_amesh = src_p.meshes [j];
                                    ax_meshes.Add(dep_amesh.Clone(dep_amesh.transMatrix));
                                }
                            }

                            // BOUNDING MESHES
                            //boundsCombinator[i].mesh      = input_p.DependsOn.parametricObject.boundsMesh;
                            //boundsCombinator[i].transform     = input_p.DependsOn.parametricObject.generator.localMatrixWithAxisRotationAndAlignment;
                            if (src_po.boundsMesh != null)
                            {
                                boundingMeshes.Add(new AXMesh(src_po.boundsMesh, src_po.generator.localMatrixWithAxisRotationAndAlignment));
                            }



                            // GAME_OBJECTS

                            if (makeGameObjects && !parametricObject.combineMeshes)
                            {
                                GameObject plugGO = src_po.generator.generate(true, initiator_po, isReplica);
                                if (plugGO != null)
                                {
                                    plugGO.transform.parent = go.transform;
                                }
                            }
                        }
                    }
                }
            }



            // *** GROUPEES - Generate the groupees here
            // so that all the inputs (thicknesses, etc.) have been processed first.

            //List<AXParametricObject> visited_pos = new List<AXParametricObject>();
            if (parametricObject.Groupees != null && parametricObject.Groupees.Count > 0)
            {
                for (int i = 0; i < parametricObject.Groupees.Count; i++)
                {
                    AXParametricObject groupee = parametricObject.Groupees [i];
                    //if (! parametricObject.visited_pos.Contains (groupee))

                    //Debug.Log("groupee.generateOutputNow: " + groupee.Name + " isAltered="+groupee.isAltered);
                    if (groupee.isAltered)
                    {
                        groupee.generateOutputNow(makeGameObjects, initiator_po);
                        //Debug.Log("XXXXX: " + groupee.Output.meshes.Count);
                        groupee.isAltered = false;
                        parametricObject.model.AlteredPOs.Remove(groupee);
                    }
                }
            }



            // BOUNDING



            // Process
            for (int i = 0; i < parametricObject.Groupees.Count; i++)
            {
                AXParametricObject groupee = parametricObject.Groupees [i];


                //if (input_p != null && input_p.DependsOn != null && input_p.DependsOn.meshes != null && input_p.DependsOn.meshes.Count > 0) {
                //if (groupee != null && groupee.is3D() && ! groupee.hasDependents() && groupee.Output != null && groupee.Output.meshes != null)
                if (groupee != null && groupee.is3D() && groupee.shouldRenderSelf(true))
                {
                    // AX_MESHES
                    //Debug.Log("(*) (*) (*) (*) groupee: " + groupee.Name + " " +groupee.Output.meshes.Count + " isAltered = " + groupee.isAltered);
                    if (groupee.Output != null && groupee.Output.meshes != null)
                    {
                        for (int j = 0; j < groupee.Output.meshes.Count; j++)
                        {
                            AXMesh dep_amesh = groupee.Output.meshes [j];
                            ax_meshes.Add(dep_amesh.Clone(dep_amesh.transMatrix));
                        }
                    }


                    // BOUNDING MESHES
                    //boundsCombinator[i].mesh      = input_p.DependsOn.parametricObject.boundsMesh;
                    //boundsCombinator[i].transform     = input_p.DependsOn.parametricObject.generator.localMatrixWithAxisRotationAndAlignment;
                    if (groupee.boundsMesh != null)
                    {
                        boundingMeshes.Add(new AXMesh(groupee.boundsMesh, groupee.generator.localMatrixWithAxisRotationAndAlignment));
                    }



                    // GAME_OBJECTS

                    if (makeGameObjects && !parametricObject.combineMeshes)
                    {
                        GameObject plugGO = groupee.generator.generate(true, initiator_po, isReplica);
                        if (plugGO != null)
                        {
                            plugGO.transform.parent = go.transform;
                        }
                    }
                }
            }



            // FINISH AX_MESHES


            //Debug.Log("ORG: " + ax_meshes.Count);
            parametricObject.finishMultiAXMeshAndOutput(ax_meshes, isReplica);



            // FINISH BOUNDS

            CombineInstance[] boundsCombinator = new CombineInstance[boundingMeshes.Count];
            for (int bb = 0; bb < boundsCombinator.Length; bb++)
            {
                boundsCombinator[bb].mesh      = boundingMeshes[bb].mesh;
                boundsCombinator[bb].transform = boundingMeshes[bb].transMatrix;
            }
            setBoundsWithCombinator(boundsCombinator);


            if (P_BoundsX != null && !P_BoundsX.hasRelations() && !P_BoundsX.hasExpressions())
            {
                P_BoundsX.FloatVal = parametricObject.bounds.size.x;
            }

            if (P_BoundsY != null && !P_BoundsY.hasRelations() && !P_BoundsY.hasExpressions())
            {
                P_BoundsY.FloatVal = parametricObject.bounds.size.y;
            }

            if (P_BoundsZ != null && !P_BoundsZ.hasRelations() && !P_BoundsZ.hasExpressions())
            {
                P_BoundsZ.FloatVal = parametricObject.bounds.size.z;
            }



            // FINISH GAME_OBJECTS

            if (makeGameObjects)
            {
                if (parametricObject.combineMeshes)
                {
                    go = parametricObject.makeGameObjectsFromAXMeshes(ax_meshes, true, false);


                    // COMBINE ALL THE MESHES
                    CombineInstance[] combine = new CombineInstance[ax_meshes.Count];

                    int combineCt = 0;
                    for (int i = 0; i < ax_meshes.Count; i++)
                    {
                        AXMesh _amesh = ax_meshes [i];
                        combine [combineCt].mesh      = _amesh.mesh;
                        combine [combineCt].transform = _amesh.transMatrix;
                        combineCt++;
                    }

                    Mesh combinedMesh = new Mesh();
                    combinedMesh.CombineMeshes(combine);

                    // If combine, use combined mesh as invisible collider
                    MeshFilter mf = (MeshFilter)go.GetComponent(typeof(MeshFilter));

                    if (mf == null)
                    {
                        mf = (MeshFilter)go.AddComponent(typeof(MeshFilter));
                    }

                    if (mf != null)
                    {
                        mf.sharedMesh = combinedMesh;
                        parametricObject.addCollider(go);
                    }
                }

                else
                {
                    Matrix4x4 tmx = parametricObject.getLocalMatrix();

                    go.transform.rotation   = AXUtilities.QuaternionFromMatrix(tmx);
                    go.transform.position   = AXUtilities.GetPosition(tmx);
                    go.transform.localScale = parametricObject.getLocalScaleAxisRotated();
                }
                return(go);
            }


            //parametricObject.model.sw.milestone(parametricObject.Name + " generate");


            return(null);
        }
コード例 #3
0
        // GROUPER::GENERATE
        public override GameObject generate(bool makeGameObjects, AXParametricObject initiator_po, bool isReplica)
        {
            //if (ArchimatixUtils.doDebug)
            //Debug.Log (parametricObject.Name + " generate +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");


            if (!parametricObject.isActive)
            {
                return(null);
            }



            preGenerate();


            //GameObject go = null;

//			if (makeGameObjects && !parametricObject.combineMeshes)
//				go = ArchimatixUtils.createAXGameObject (parametricObject.Name, parametricObject);


            List <AXMesh> ax_meshes = new List <AXMesh> ();

            Net3dBool.BooleanModeller modeler;
            Net3dBool.Solid           resSolid = null;


            // BOUNDING

            List <AXMesh> boundingMeshes = new List <AXMesh> ();


//			List<Net3dBool.Solid> solids = new List<Net3dBool.Solid> ();
//			List<Net3dBool.Solid> voids = new List<Net3dBool.Solid> ();


            AXParameter        src_p  = null;
            AXParametricObject src_po = null;

            if (inputs != null && inputs.Count > 0)
            {
                Debug.Log("inputs.Count = " + inputs.Count);

                Mesh tmpMesh1 = new Mesh();
                Mesh tmpMesh2 = new Mesh();

                src_p = inputs [0].DependsOn;
                if (src_p != null)
                {
                    src_po = src_p.parametricObject;


                    CombineInstance[] combinator = new CombineInstance[src_po.Output.meshes.Count];
                    for (int bb = 0; bb < combinator.Length; bb++)
                    {
                        combinator [bb].mesh      = src_po.Output.meshes [bb].mesh;
                        combinator [bb].transform = src_po.Output.meshes [bb].transMatrix;
                    }
                    tmpMesh1 = new Mesh();
                    tmpMesh1.CombineMeshes(combinator);
                    tmpMesh1.RecalculateNormals();

//					Debug.Log("//////////////////");
//					for (int i = 0; i < tmpMesh1.vertices.Length; i++) {
//						Vector3 vert = tmpMesh1.vertices [i];
//						Debug.Log ("["+i+"] "+vert);
//
//					}
//					Debug.Log("//////////////////");
                }

                if (inputs.Count > 1 && inputs [1] != null)
                {
                    src_p = inputs [1].DependsOn;

                    if (src_p != null)
                    {
                        src_po = src_p.parametricObject;

                        if (src_po != null)
                        {
                            CombineInstance[] combinator = new CombineInstance[src_po.Output.meshes.Count];
                            for (int bb = 0; bb < combinator.Length; bb++)
                            {
                                combinator [bb].mesh      = src_po.Output.meshes [bb].mesh;
                                combinator [bb].transform = src_po.Output.meshes [bb].transMatrix;
                            }
                            tmpMesh2 = new Mesh();
                            tmpMesh2.CombineMeshes(combinator);
                            tmpMesh2.RecalculateNormals();



                            // convert to csg meshes
                            int len1 = tmpMesh1.vertices.Length;
                            Net3dBool.Point3d[] pverts1 = new Net3dBool.Point3d[len1];
                            Vector3             vert1;
                            for (int i = 0; i < len1; i++)
                            {
                                vert1 = tmpMesh1.vertices [i];

                                pverts1 [i] = new Net3dBool.Point3d(vert1.x, vert1.y, vert1.z);
                            }
                            Net3dBool.Solid a = new Net3dBool.Solid(pverts1,
                                                                    tmpMesh1.triangles,
                                                                    getColorArray(len1, Color.red));



                            // convert to csg meshes
                            int len2 = tmpMesh2.vertices.Length;
                            Net3dBool.Point3d[] pverts2 = new Net3dBool.Point3d[len2];
                            Vector3             vert2;
                            for (int i = 0; i < len2; i++)
                            {
                                vert2 = tmpMesh2.vertices [i];

                                pverts2[i] = new Net3dBool.Point3d(vert2.x, vert2.y, vert2.z);
                            }
                            Net3dBool.Solid b = new Net3dBool.Solid(pverts2,
                                                                    tmpMesh2.triangles,
                                                                    getColorArray(len2, Color.red));



                            modeler  = new Net3dBool.BooleanModeller(a, b);
                            resSolid = modeler.getDifference();



                            Mesh tmesh = new Mesh();
                            int  mlen  = resSolid.getVertices().Length;
                            Net3dBool.Point3d[] bverts = resSolid.getVertices();

                            Vector3[] vertices = new Vector3[mlen];

                            for (int i = 0; i < mlen; i++)
                            {
                                Net3dBool.Point3d p = bverts [i];
                                vertices [i] = new Vector3((float)p.x, (float)p.y, (float)p.z);
                            }
                            tmesh.vertices = vertices;

                            tmesh.triangles = resSolid.getIndices();

                            tmesh.RecalculateNormals();



                            ax_meshes.Add(new AXMesh(tmesh));


                            parametricObject.finishMultiAXMeshAndOutput(ax_meshes, isReplica);
                        }
                    }
                    return(null);
                }



//
//				for (int ii = 0; ii < inputs.Count; ii++) {
//					src_p = inputs [ii].DependsOn;
//
//					if (src_p == null)
//						continue;
//
//					Debug.Log ("ii=" + ii + ": " + src_p.Name);
//
//					if (src_p != null) {
//						src_po = src_p.parametricObject;
//
//
//						if (src_po.is3D ()) {
//							if (src_po.Output != null && src_po.Output.meshes != null) {
//								for (int j = 0; j < src_po.Output.meshes.Count; j++) {
//
//									int len = src_po.Output.meshes [j].mesh.vertices.Length;
//
//									// convert to csg meshes
//									Net3dBool.Point3d[] pverts = new Net3dBool.Point3d[len];
//									Vector3 vert;
//									for (int i = 0; i < len; i++) {
//										vert = src_po.Output.meshes [j].mesh.vertices [i];
//
//										pverts [i] = new Net3dBool.Point3d (vert.x, vert.y, vert.z);
//									}
//
//									if (ii == 0) {
//										solids.Add (new Net3dBool.Solid (pverts,
//											src_po.Output.meshes [j].mesh.triangles,
//											getColorArray (len, Color.red)));
//									} else {
//										voids.Add (new Net3dBool.Solid (pverts,
//											src_po.Output.meshes [j].mesh.triangles,
//											getColorArray (len, Color.red)));
//
//									}
//
//									Mesh tmesh = new Mesh ();
//									int mlen = resSolid.getVertices ().Length;
//									Net3dBool.Point3d[] bverts = resSolid.getVertices ();
//
//									Vector3[] vertices = new Vector3[mlen];
//
//									for (int i = 0; i < mlen; i++) {
//										Net3dBool.Point3d p = bverts [i];
//										vertices [i] = new Vector3 ((float)p.x, (float)p.y, (float)p.z);
//									}
//									tmesh.vertices = vertices;
//
//									tmesh.triangles = resSolid.getIndices ();
//
//									tmesh.RecalculateNormals ();
//
//
//									AXMesh dep_amesh = src_po.Output.meshes [j];
//									ax_meshes.Add (dep_amesh.Clone (dep_amesh.transMatrix));
//								}
//							}
//
//
//						}
//					}
//
//				}



                //now have all our solids and voids

//				Debug.Log (solids.Count + " -- " + voids.Count);
//
//				if (solids.Count == 0 || voids.Count == 0)
//					return null;
//
//
//				for (int ss=2; ss<solids.Count; ss++)
//					{
//						modeler = new Net3dBool.BooleanModeller (resSolid, solids [1]);
//						resSolid = modeler.getUnion();
//					}
//
//				if (solids.Count == 1) {
//					modeler = new Net3dBool.BooleanModeller (solids [0], voids [0]);
//					resSolid = modeler.getDifference ();
//
//					if (voids.Count > 1) {
//						for (int v = 1; v < voids.Count; v++) {
//							modeler = new Net3dBool.BooleanModeller (resSolid, voids [v]);
//							resSolid = modeler.getDifference ();
//						}
//					}
//				}
//				else
//				{
//					modeler = new Net3dBool.BooleanModeller (solids [0], solids [1]);
//					resSolid = modeler.getUnion();					for (int ss=2; ss<solids.Count; ss++)
//					{
//						modeler = new Net3dBool.BooleanModeller (resSolid, solids [1]);
//						resSolid = modeler.getUnion();
//					}
//
//					for (int ss=2; ss<solids.Count; ss++)
//					{
//						modeler = new Net3dBool.BooleanModeller (resSolid, solids [ss]);
//						resSolid = modeler.getUnion();
//					}
//					for (int vv=0; vv<voids.Count; vv++)
//					{
//						modeler = new Net3dBool.BooleanModeller (resSolid, voids[vv]);
//						resSolid = modeler.getDifference();
//					}
//
//				}
//
//				if (resSolid == null)
//					return null;
//
//				Mesh tmesh = new Mesh ();
//				int mlen = resSolid.getVertices ().Length;
//				Net3dBool.Point3d[] bverts = resSolid.getVertices ();
//
//				Vector3[] vertices = new Vector3[mlen];
//
//				for (int i = 0; i < mlen; i++) {
//					Net3dBool.Point3d p = bverts [i];
//					vertices [i] = new Vector3 ((float)p.x, (float)p.y, (float)p.z);
//				}
//				tmesh.vertices = vertices;
//
//				tmesh.triangles = resSolid.getIndices ();
//
//				tmesh.RecalculateNormals ();
//



                // BOUNDING MESHES
                //boundsCombinator[i].mesh      = input_p.DependsOn.parametricObject.boundsMesh;
                //boundsCombinator[i].transform     = input_p.DependsOn.parametricObject.generator.localMatrixWithAxisRotationAndAlignment;
//				if (src_po.boundsMesh != null)
//					boundingMeshes.Add (new AXMesh (src_po.boundsMesh, src_po.generator.localMatrixWithAxisRotationAndAlignment));


                // GAME_OBJECTS

//						if (makeGameObjects && !parametricObject.combineMeshes) {
//
//							GameObject plugGO = src_po.generator.generate (true, initiator_po, isReplica);
//							if (plugGO != null)
//								plugGO.transform.parent = go.transform;
//						}

                //ax_meshes.Add (new AXMesh (tmesh));


                //P_Output.meshes = src_p.meshes;



                // FINISH AX_MESHES


                //Debug.Log("ORG: " + ax_meshes.Count);
                parametricObject.finishMultiAXMeshAndOutput(ax_meshes, isReplica);



                // FINISH BOUNDS

                CombineInstance[] boundsCombinator = new CombineInstance[boundingMeshes.Count];
                for (int bb = 0; bb < boundsCombinator.Length; bb++)
                {
                    boundsCombinator [bb].mesh      = boundingMeshes [bb].mesh;
                    boundsCombinator [bb].transform = boundingMeshes [bb].transMatrix;
                }
                setBoundsWithCombinator(boundsCombinator);


                if (P_BoundsX != null && !P_BoundsX.hasRelations() && !P_BoundsX.hasExpressions())
                {
                    P_BoundsX.FloatVal = parametricObject.bounds.size.x;
                }

                if (P_BoundsY != null && !P_BoundsY.hasRelations() && !P_BoundsY.hasExpressions())
                {
                    P_BoundsY.FloatVal = parametricObject.bounds.size.y;
                }

                if (P_BoundsZ != null && !P_BoundsZ.hasRelations() && !P_BoundsZ.hasExpressions())
                {
                    P_BoundsZ.FloatVal = parametricObject.bounds.size.z;
                }
            }



            // FINISH GAME_OBJECTS

//			if (makeGameObjects) {
//				if (parametricObject.combineMeshes) {
//					go = parametricObject.makeGameObjectsFromAXMeshes (ax_meshes, true, false);
//
//
//					// COMBINE ALL THE MESHES
//					CombineInstance[] combine = new CombineInstance[ax_meshes.Count];
//
//					int combineCt = 0;
//					for (int i = 0; i < ax_meshes.Count; i++) {
//						AXMesh _amesh = ax_meshes [i];
//						combine [combineCt].mesh = _amesh.mesh;
//						combine [combineCt].transform = _amesh.transMatrix;
//						combineCt++;
//					}
//
//					Mesh combinedMesh = new Mesh ();
//					combinedMesh.CombineMeshes (combine);
//
//					// If combine, use combined mesh as invisible collider
//					MeshFilter mf = (MeshFilter)go.GetComponent (typeof(MeshFilter));
//
//					if (mf == null)
//						mf = (MeshFilter)go.AddComponent (typeof(MeshFilter));
//
//					if (mf != null) {
//						mf.sharedMesh = combinedMesh;
//						parametricObject.addCollider (go);
//					}
//				} else {
//					Matrix4x4 tmx = parametricObject.getLocalMatrix ();
//
//					go.transform.rotation = AXUtilities.QuaternionFromMatrix (tmx);
//					go.transform.position = AXUtilities.GetPosition (tmx);
//					go.transform.localScale = parametricObject.getLocalScaleAxisRotated ();
//				}
//				return go;
//			}



            return(null);
        }