Hi,
I need to upload my model to Matlab in 3D Foundation environment. I need to upload it in f3d format. I created this file format
in Fusion, but Matlab won't open it for me. I get this error: "Not a binary MAT-file. Try load -ASCII to read as text."
When I try to open my model as text, I get this error: "Unable to read file 'robot_sestaven.f3d'. Input must be a MAT-file or
an ASCII file containing numeric data with same number of columns in each row."
Does anyone know how to create the correct f3d format for my model?
Thanks for the advice

 Respuesta aceptada

Jan Houska
Jan Houska el 7 de Sept. de 2022

0 votos

Hi Pavel-Jakub,
the F3D format used by 3D Foundation is not the same format as used in Fusion. This is just a name coincidence. You can import into 3D Foundation from another 3D format (like e.g. FBX, X3D, STL, ...), then save it to the F3D format from 3D Foundation.
Good Luck, Jan

7 comentarios

Pavel-Jakub Novotný
Pavel-Jakub Novotný el 7 de Sept. de 2022
Oh, I didn't know that. So could you advise me how to save it in matlab f3d format?
Jan Houska
Jan Houska el 7 de Sept. de 2022
You first use F3D.World.load or F3D.Actor.load to load the geometry to 3D Foundation, then you use F3D.World.save or F3D.Actor.save to save into the native F3D format. You use the World methods to load/save the entire world or the Actor methods to load/save the specified actor (and its children). For more information please see "help F3D.Actor.load" and "help F3D.Actor.save".
Good Luck, Jan
Pavel-Jakub Novotný
Pavel-Jakub Novotný el 8 de Sept. de 2022
Editada: Pavel-Jakub Novotný el 8 de Sept. de 2022
I uploaded my model as an stl and we saved it to an f3d (native) file. When I try to load it, an error pops up: Unsupported file format 'Robot_uz.f3d'. But it is written in the help that it is a fully supported format for all features. So what's wrong?
Thanks, PJ
Jan Houska
Jan Houska el 9 de Sept. de 2022
It would probably help if you post the functions you use for loading and saving the model - i.e. the sequence of functions that results in the error you describe above. Generally, the .f3d format should indeed support all features that you are able to import from other formats, so the problem is probably somwehere else.
Jan
I use this program to load model parts and then save them in f3d format.
MW = F3D.World('WestPoint')
initialize(MW, [80, -80, 80], [0 0 5]);
MW.AngleUnits = 'deg';
Floor = F3D.Geometry.templateFloor(MW.Root, [200 200 0.1]);
Body = addChild(MW.Root,'Body');
load(Body, 'Telo_sestaveno.stl');
Body.Location = [0 0 3];
%% first leg
stLeg_stJoint = addChild(Body,'stLeg_stJoint');
load(stLeg_stJoint,'noha_1_sestava2.stl');
stLeg_stJoint.Location = [8 0 2];
stLeg_stJoint.Rotation = [0 0 0];
stLeg_stJoint.Color = [1 0 0];
stLeg_ndJoint = addChild(stLeg_stJoint,'stLeg_ndJoint');
load(stLeg_ndJoint,'noha_2_sestava.stl');
stLeg_ndJoint.Location = [7.5 0 0];
stLeg_ndJoint.Rotation = [0 -30 0];
stLeg_rdJoint = addChild(stLeg_ndJoint,'stLeg_ndJoint');
load(stLeg_rdJoint,'noha_3_sestava.stl');
stLeg_rdJoint.Location = [7.5 0 0];
stLeg_rdJoint.Rotation = [0 90 0];
stLeg_paw = addChild(stLeg_rdJoint,'stLeg_paw');
load(stLeg_paw,'packa_sestava.stl');
stLeg_paw.Location = [8 0 0.5];
stLeg_paw.Rotation = [0 -60 0];
%% second leg
ndLeg_stJoint = addChild(Body,'ndLeg_stJoint');
load(ndLeg_stJoint,'noha_1_sestava2.stl');
ndLeg_stJoint.Location = [0 8 2];
ndLeg_stJoint.Rotation = [0 0 90];
ndLeg_stJoint.Color = [0 1 0];
ndLeg_ndJoint = addChild(ndLeg_stJoint,'ndLeg_ndJoint');
load(ndLeg_ndJoint,'noha_2_sestava.stl');
ndLeg_ndJoint.Location = [7.5 0 0];
ndLeg_ndJoint.Rotation = [0 -30 0];
ndLeg_rdJoint = addChild(ndLeg_ndJoint,'ndLeg_ndJoint');
load(ndLeg_rdJoint,'noha_3_sestava.stl');
ndLeg_rdJoint.Location = [7.5 0 0];
ndLeg_rdJoint.Rotation = [0 90 0];
ndLeg_paw = addChild(ndLeg_rdJoint,'ndLeg_paw');
load(ndLeg_paw,'packa_sestava.stl');
ndLeg_paw.Location = [8 0 0.5];
ndLeg_paw.Rotation = [0 -60 0];
%% Third leg
rdLeg_stJoint = addChild(Body,'rdLeg_stJoint');
load(rdLeg_stJoint,'noha_1_sestava2.stl');
rdLeg_stJoint.Location = [-8 0 2];
rdLeg_stJoint.Rotation = [0 0 180];
rdLeg_ndJoint = addChild(rdLeg_stJoint,'rdLeg_ndJoint');
load(rdLeg_ndJoint,'noha_2_sestava.stl');
rdLeg_ndJoint.Location = [7.5 0 0];
rdLeg_ndJoint.Rotation = [0 -30 0];
rdLeg_rdJoint = addChild(rdLeg_ndJoint,'rdLeg_ndJoint');
load(rdLeg_rdJoint,'noha_3_sestava.stl');
rdLeg_rdJoint.Location = [7.5 0 0];
rdLeg_rdJoint.Rotation = [0 90 0];
rdLeg_paw = addChild(rdLeg_rdJoint,'rdLeg_paw');
load(rdLeg_paw,'packa_sestava.stl');
rdLeg_paw.Location = [8 0 0.5];
rdLeg_paw.Rotation = [0 -60 0];
%% fourth leg
thLeg_stJoint = addChild(Body,'thLeg_stJoint');
load(thLeg_stJoint,'noha_1_sestava2.stl');
thLeg_stJoint.Location = [0 -8 2];
thLeg_stJoint.Rotation = [0 0 -90];
thLeg_ndJoint = addChild(thLeg_stJoint,'thLeg_ndJoint');
load(thLeg_ndJoint,'noha_2_sestava.stl');
thLeg_ndJoint.Location = [7.5 0 0];
thLeg_ndJoint.Rotation = [0 -30 0];
thLeg_rdJoint = addChild(thLeg_ndJoint,'thLeg_ndJoint');
load(thLeg_rdJoint,'noha_3_sestava.stl');
thLeg_rdJoint.Location = [7.5 0 0];
thLeg_rdJoint.Rotation = [0 90 0];
thLeg_paw = addChild(thLeg_rdJoint,'thLeg_paw');
load(thLeg_paw,'packa_sestava.stl');
thLeg_paw.Location = [8 0 0.5];
thLeg_paw.Rotation = [0 -60 0];
save('robot_sestaven_2.f3d')
I used this program to open the newly created file.
MW = F3D.World('WestPoint');
initialize(MW, [80, -80, 80], [0 0 5]);
%MW.CoordinateSystem = 'unreal';
MW.AngleUnits = 'deg';
VP = MW.Viewports.Main;
VP.Title = 'WestPoint';
Path = fileparts(which(mfilename));
Floor = F3D.Geometry.templateFloor(MW.Root, [200 200 0.1]);
Robot = addChild(MW.Root, 'Robot');
load(Robot, 'robot_sestaven_2.f3d');
Robot.Location = [0 0 1.5];
Thanks for advice, PJ
Jan Houska
Jan Houska el 16 de Sept. de 2022
Editada: Jan Houska el 16 de Sept. de 2022
Hi PJ,
the last line of the save script should read
save(MW, 'robot_sestaven_2.f3d');
instead of
save('robot_sestaven_2.f3d')
Good Luck, Jan
Pavel-Jakub Novotný
Pavel-Jakub Novotný el 16 de Sept. de 2022
Thanks, it's working now.
PJ

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2022a

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by