hii, I am currently working on a project which calculates the tiling waste in the floorplan, I have created a simple C# script for dividing the irregular surface into grids, But what I want to do is to divide the surface with fixed dimension instead of count
Hello
what I understand is you have a tile of (w, l) or (width length) and you want to put that on any shape.
If shape bounding box is W L (Width Length) the max number is
nw = Ceiling(W/w)
nl = Ceiling(L/l)
You can get W and H doing that, W is X of deconstruct component, L is Y.
Please help. How can I do parametric series of extrusion.
Simple rectangle will do. I want to create this series of extrusion or sweep. My reference line is already parametric for some reason my solid model didn’t follow. I use sweep in this case
That - entry level - C# divides a “rectangle” derived from the box (pts 0, 1, 2, 3) and then uses a BrepFace containment filter by testing the center of a given divided “module” (a rectangle in this case) for inclusion. Meaning that you should:
Control the output: Meshes (faster) or Breps (general case - see PS2)?
Elaborate other filters as well (for instance testing all points for inclusion etc etc).
Elaborate a safety net (i.e. respect max N of divisions in X.Y: just imagine attempting to divide a 100 m long direction using a step like 0.001).
Include an option: get things inside or outside the BrepFace.
Use the BrepFace plane for the Box and thus use any BrepFace “rotated” in 3d space.
PS1: Other than that are you after some recursive loop for the remaining “spaces” ? I.e. If NOT an inclusion is found AND if at least one point is included … then use half x/y for the first pass (loop) and then half of the half … blah, blah. This means that the modules wouldn’t be equal (obviously) AND you may end with a BIG N of “mini” modules (up to some min size [ doc tolerance for instance]).
PS2: Obviously another way is to get the Curve intersection between the Rectangle (as Curve) and the prox BrepFace Loop. This means that the modules wouldn’t be rectangles AND you can’t use Meshes (for the general case: any planar BrepFace with curvy BrepLoops etc etc).
For the other thing (Linear alu/steel profiles extrusions) use the
Brep.CreatePlanarBreps (i.e. get the Face) and Brep.CreateFromOffsetFace (i.e. use the Face) Methods
Note: Rhino is a surface modeller … meaning that MAY become very slow when “solids” (closed Breps) are required. In general and if you are after solids (and most notably post operations like fillets etc) avoid using Rhino at any cost.
The “area” sketched (Nothing to do with some Inside/Outside filter) is not a rectange: is the Intersection of the candidate Rectangle as Curve (if is valid according to some criterium) VS the BrepLoops as Curves. This means NO MESHES as output (general case).
For getting the Loops:
List< Curve > loops = new List< Curve >();
foreach(BrepLoop loop in face.Loops) loops.Add(loop.To3dCurve());
That said: 1 to 10 what is your rate about your C# level? (question related with various things that this case requires in order to be the complete thingy)
2 months means minus 1 (min), he he. You can hope for 1 after 6 months (min). Then … you’ll need ~ 5 years to get the gist of C# (and several more in order to do anything imaginable). Then … is kinda martial arts: the zone state of things and the likes, blah, blah.
hahaha that’s true, but what you mean before is about getting the intersections of those two lines and get the curve? maybe I need to find an alternative way in gh to do that (sad tho hhhhh)
like this
Jesus C ! You are lost in space I guess (life sucks).
For a given quad of a candidate module (Rectangle) points .
If no point is inside the face > adios amigos > add null (that’s handy for other type of “post” things).
Get the Rectange and then a Curve out of it (rect.ToNurbsCurve()).
Test for ccx events (Curve.Intersection(s)) between that Curve and each of the Curve loops (as above).
If some Curves (general case) are found add the resulting Breps (Brep.CreatePlanarBreps(crvs)) to the result Tree.
If no ccx events occured add the Rectange Curve as Brep.
Note: a given Rectangle MAY have all the 4 corner points inside a face while there’s still potential ccx events (but you may use a test by finding the min prox distance between the center and the loops > if this is greater than the half diagonal > NO ccx test is required [ just add the Rectangle]).
That said C# is a thingy for the brave. Thus I added some stuff BUT not the code for the “pieces as above”.
Offset from Clipper is not weird, freaky or whatever. There are drawbacks because it is polyline. But is the Nature really continuous ? At the end everything is atoms, quark … light … So in real life good polyline is better than bad Nurbs/Bezier curve.
Whatever it is good to see you Peter @PeterFotiadis , you are always a bit “cryptic” but you always bring nice solutions.