Surface.Domain

Is this X,Y,Z or UV direction?

Please put it there, it’s unclear.

Thanks.

It is the parametric domain. A surface has two parameters, typically called u and v. These parameters both have a domain, and can vary between the domain’s lower and upper boundaries.

1 Like

Thanks @menno,

Do you know a way to get the min/max x,y,z domain of a brepface?

Update:
I think I got it. :slight_smile:
Something like this:

trimmed_surface = tmp_face.Trim(tmp_face.Domain(0),tmp_face.Domain(1))
Rhino.Geometry.Surface.GetBoundingBox(trimmed_surface,Rhino.Geometry.Plane.WorldXY)

Be careful, because a BRep face can be trimmed. I think it is better do something like

BrepFace bf;
using (var b = bf.ToBrep())
{
  BoundingBox bb = b.GetBoundingBox(true);
}
1 Like

Yep, I thought about that. I hope my solution is similar to converting to brep and getting the bounding box of that :crossed_fingers:

Nope!

Why would:
BrepFace.Trim(BrepFace.Domain(0),BrepFace.Domain(1))
and
BrepFace.UnderlyingSurface()

give the same result?
:roll_eyes:

Update:
HA:
BrepFace.ToBrep() also gives the untrimmed surface

Update2:
BrepFace.Evaluate()
Also gives the untrimmed surface points.

BrepFace.ToNurbsSurface()… If I understood correctly.

Ah, nope, that wasn’t it - there was a trick though… :confounded:
(this one always gets me)

This is it:

new_face=face.DuplicateFace(False)

Gets a new face that is “shrunk”

Try this on a trimmed surface:

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

obj_id=rs.GetObject("Select surface",8)
brep=rs.coercebrep(obj_id)
new_face=brep.Faces[0].DuplicateFace(False)
bb=new_face.GetBoundingBox(True)
corners=bb.GetCorners()
rs.AddPoints(corners)
1 Like

Nope, it’s still the untrimmed surface.

That’s the one, thanks a lot Mitch. :clap: