From: Hane on
Hi,
I am trying to generate a 3D object to use in a CAD tool. The object is a cube with a random surface on top of that as one of its faces. I already generated the random surface usig surf command. I should only close the surface like a cube (vertically and horizontally) and make it 3D but I do not know HOW?

I wonder if anybody has any helpful idea?

Thanks,
Hane
From: Walter Roberson on
Hane wrote:

> I am trying to generate a 3D object to use in a CAD tool. The object is
> a cube with a random surface on top of that as one of its faces. I
> already generated the random surface usig surf command. I should only
> close the surface like a cube (vertically and horizontally) and make it
> 3D but I do not know HOW?

Probably your easiest way would be to use patch()
From: Hane on
Walter Roberson <roberson(a)hushmail.com> wrote in message <dHjMn.20071$7d5.13649(a)newsfe17.iad>...
> Hane wrote:
>
> > I am trying to generate a 3D object to use in a CAD tool. The object is
> > a cube with a random surface on top of that as one of its faces. I
> > already generated the random surface usig surf command. I should only
> > close the surface like a cube (vertically and horizontally) and make it
> > 3D but I do not know HOW?
>
> Probably your easiest way would be to use patch()


I do'nt think that the patch command can produce this 3D surface. Can you please clarify it more?
From: Walter Roberson on
Hane wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <dHjMn.20071$7d5.13649(a)newsfe17.iad>...
>> Hane wrote:
>>
>> > I am trying to generate a 3D object to use in a CAD tool. The object
>> is > a cube with a random surface on top of that as one of its faces.
>> I > already generated the random surface usig surf command. I should
>> only > close the surface like a cube (vertically and horizontally) and
>> make it > 3D but I do not know HOW?
>>
>> Probably your easiest way would be to use patch()

> I do'nt think that the patch command can produce this 3D surface. Can
> you please clarify it more?

Patch can be used for 3D surfaces and is not restricted to planar
objects. Something like,

XYZ = [0 0 0
1 0 0
1 0 1
1 1 1
1 1 0
0 1 0
0 1 1
0 0 1
0 0 0];
patch(XYZ(:,1), XYZ(:,2), XYZ(:,3));
From: Hane on
Walter Roberson <roberson(a)hushmail.com> wrote in message <NkDMn.33869$rU6.19121(a)newsfe10.iad>...
> Hane wrote:
> > Walter Roberson <roberson(a)hushmail.com> wrote in message
> > <dHjMn.20071$7d5.13649(a)newsfe17.iad>...
> >> Hane wrote:
> >>
> >> > I am trying to generate a 3D object to use in a CAD tool. The object
> >> is > a cube with a random surface on top of that as one of its faces.
> >> I > already generated the random surface usig surf command. I should
> >> only > close the surface like a cube (vertically and horizontally) and
> >> make it > 3D but I do not know HOW?
> >>
> >> Probably your easiest way would be to use patch()
>
> > I do'nt think that the patch command can produce this 3D surface. Can
> > you please clarify it more?
>
> Patch can be used for 3D surfaces and is not restricted to planar
> objects. Something like,
>
> XYZ = [0 0 0
> 1 0 0
> 1 0 1
> 1 1 1
> 1 1 0
> 0 1 0
> 0 1 1
> 0 0 1
> 0 0 0];
> patch(XYZ(:,1), XYZ(:,2), XYZ(:,3));




Thanks for your help. I could generate a box around my random surface but I still can not merge them together to make a 3D object. Do you have any suggestion?