コード例 #1
0
                /// <summary>
                /// Extrude the model entities `dimTags' by a combined translation and
                /// rotation of `angle' radians, along (`dx', `dy', `dz') and around the axis
                /// of revolution defined by the point (`x', `y', `z') and the direction
                /// (`ax', `ay', `az'). The angle should be strictly smaller than Pi. Return
                /// extruded entities in `outDimTags'. If `numElements' is not empty, also
                /// extrude the mesh: the entries in `numElements' give the number of elements
                /// in each layer. If `height' is not empty, it provides the (cumulative)
                /// height of the different layers, normalized to 1.
                /// </summary>
                public static void Twist(ValueTuple <int, int>[] dimTags, double x, double y, double z, double dx, double dy, double dz, double ax, double ay, double az, double angle, out ValueTuple <int, int>[] outDimTags, int[] numElements = default, double[] heights = default, bool recombine = false)
                {
                    var dimarray = dimTags.ToIntArray();

                    unsafe
                    {
                        int *ptrss;
                        long outcount = 0;
                        if (numElements == default)
                        {
                            numElements = new int[0];
                        }
                        if (heights == default)
                        {
                            heights = new double[0];
                        }
                        Gmsh_Warp.GmshModelGeoTwist(dimarray, dimarray.LongLength, x, y, z, dx, dy, dz, ax, ay, az, angle, &ptrss, ref outcount, numElements, numElements.LongLength, heights, heights.LongLength, Convert.ToInt32(recombine), ref Gmsh._staticreff);

                        var array = UnsafeHelp.ToIntArray(ptrss, outcount);
                        outDimTags = array.ToIntPair();
                        Gmsh.CheckException(MethodBase.GetCurrentMethod().MethodHandle);
                    }
                }