Add CAD & CG assets generators
This commit is contained in:
parent
db7a44f479
commit
cc723b1bb2
2 changed files with 34 additions and 6 deletions
34
flake.nix
34
flake.nix
|
@ -137,9 +137,37 @@
|
||||||
megapose6d = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/megapose6d { inherit webdataset; };
|
megapose6d = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/megapose6d { inherit webdataset; };
|
||||||
spatialmath = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/spatialmath { inherit ansitable; };
|
spatialmath = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/spatialmath { inherit ansitable; };
|
||||||
rcg-pipeline = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/rcg-pipeline { bpy = bpy-lib; inherit rbsFrameworkSrc; };
|
rcg-pipeline = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/rcg-pipeline { bpy = bpy-lib; inherit rbsFrameworkSrc; };
|
||||||
rbs-workbench = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/freecad.robossembler { inherit freecad-py; inherit rbsFrameworkSrc; };
|
rbs-workbench = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/freecad.robossembler { inherit freecad-lib; inherit rbsFrameworkSrc; };
|
||||||
freecad-py = pkgs.python3Packages.toPythonModule (pkgs.callPackage ./pkgs/misc/freecad-lib { });
|
freecad-lib = pkgs.python3Packages.toPythonModule (pkgs.callPackage ./pkgs/misc/freecad-lib { });
|
||||||
bpy-lib = pkgs.python3Packages.toPythonModule bpy;
|
bpy-lib = pkgs.python3Packages.toPythonModule bpy;
|
||||||
|
cad-gen =
|
||||||
|
let
|
||||||
|
cad_export_script = pkgs.writers.writePython3 "cad_export_script.py"
|
||||||
|
{ libraries = [ rbs-workbench ]; }
|
||||||
|
''
|
||||||
|
import FreeCAD as App
|
||||||
|
import freecad.robossembler.utils.freecad_exporters as rbs
|
||||||
|
import sys
|
||||||
|
|
||||||
|
path = sys.argv[4]
|
||||||
|
print(path)
|
||||||
|
doc = App.openDocument(path)
|
||||||
|
rbs.publish_project_database(doc)
|
||||||
|
App.closeDocument(doc.Name)
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
pkgs.writeShellScriptBin "cad-gen"
|
||||||
|
''
|
||||||
|
export PYTHONPATH="${rbs-workbench}/${pkgs.python3.sitePackages}"
|
||||||
|
${pkgs.freecad}/bin/freecadcmd ${cad_export_script} -- --pass $1
|
||||||
|
'';
|
||||||
|
cg-gen = pkgs.writers.writePython3Bin "cg-gen"
|
||||||
|
{ libraries = [ rcg-pipeline ]; }
|
||||||
|
''
|
||||||
|
from rcg_pipeline import rcg_full_pipeline
|
||||||
|
import sys
|
||||||
|
rcg_full_pipeline(sys.argv[1])
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
@ -152,7 +180,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
inherit mayo pysdf fstl unified-planning test-script blender bpy bpy-wheel rcg-pipeline freecad-py bpy-lib;
|
inherit unified-planning test-script cad-gen cg-gen;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.ci = pkgs.mkShell { buildInputs = [ pkgs.jq ]; };
|
devShells.ci = pkgs.mkShell { buildInputs = [ pkgs.jq ]; };
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
, pythonImportsCheckHook
|
, pythonImportsCheckHook
|
||||||
, config
|
, config
|
||||||
, setuptools
|
, setuptools
|
||||||
, freecad-py
|
, freecad-lib
|
||||||
, pytestCheckHook
|
, pytestCheckHook
|
||||||
, toPythonModule
|
, toPythonModule
|
||||||
, python
|
, python
|
||||||
|
@ -26,10 +26,10 @@ buildPythonPackage rec {
|
||||||
setuptools
|
setuptools
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [ freecad-py ];
|
buildInputs = [ freecad-lib ];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
freecad-py
|
freecad-lib
|
||||||
];
|
];
|
||||||
|
|
||||||
pythonImportsCheck = [ "freecad.robossembler" ];
|
pythonImportsCheck = [ "freecad.robossembler" ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue