View Issue Details

IDProjectCategoryView StatusLast Update
0004684File formatsBugpublic2021-06-08 12:44
Reporterpragmatist Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version0.20 
Summary0004684: STEP export loses colour
DescriptionForum thread can be read over here:
https://forum.freecadweb.org/viewtopic.php?f=8&t=57226&start=10
https://forum.freecadweb.org/viewtopic.php?f=8&t=59252

In short, I am trying to model in OpenSCAD, export CSG, import to FreeCAD, export to STEP, and import to KiCad.

It works, but I lose colors during the FreeCAD part.
Steps To ReproduceYou can begin wherever you like in this list of steps, as I have uploaded the intermediary artifacts.

  1. Model in OpenSCAD using the attached .scad code
  2. Export CSG (attached .csg) including colours
  3. Verify CSG includes colours
  4. Import in to FreeCAD
  5. Select non-CSG objects only in the hierarchy and press export to STEP (attached .step)
  6. Observe STEP file - some colours are missing
  7. Import in to KiCad as a 3D model associated with a footprint - colours are missing

Use OpenSCAD code in OpenSCAD to export a CSG.
Additional InformationOpenSCAD 2021.01

MacOS 11.4

FreeCAD 0.20-24910
Tagscolors, OpenSCAD, STEP
FreeCAD Information

Activities

pragmatist

2021-06-07 11:42

reporter   ~0015705

Files previously failed to upload with server error.

pragmatist

2021-06-07 11:44

reporter   ~0015706

Here is the OpenSCAD source file. I can't upload the others as they're too long to paste as code snippets, so you'll have to reproduce from source.


// black
color("#505050")

// upper part
translate([0,0,0.3]) {
 difference() {
  linear_extrude(1.05) {
   square([2.36,3.94]);
  }
  // receiver
  // values with 1111 need updating
  translate([1.11111111,1.11111111,0.5]) {
   linear_extrude(3) {
    circle(r=0.5,$fn=25);
   }
  }
  // emitter
  // values with 1111 need updating
  translate([1.11111111,3.94-0.5,0.5]) {
   difference() {
    linear_extrude(3) {
     circle(d=0.98,$fn=25);
    }
    translate([0,0.8,0]) {
     linear_extrude(3) {
      square([1,1],center=true);
     }
    }
   }
  }
 }
}
// receiver bottom should be whiteish
color("#ffffff")
translate([1.3,1.3,0.8]) {
  linear_extrude(0.05) {
   square([2,2],center=true);
  }
}

// emitter bottom should be blackish
color("#000000")
translate([1.3,2.73,0.8]) {
  linear_extrude(0.05) {
   square([2,2],center=true);
  }
}



// pin1 marking
color("#404040")
translate([0.4,0.4,1.35]) {
 linear_extrude(0.001) {
  circle(r=0.2,$fn=10);
 }
}

// lower part
color("#dddddd")
translate([(2.36-2.1)/2,0.055,0]) {
 linear_extrude(0.3) {
  #square([2.1,3.73]);
 }
}

// pads - OFFSETS ARE CORRECT
color("#a0a0a0")
translate([(2.36-2.1)/2+(2.1-2)/2,0.1,-0.01]) {
 linear_extrude(0.01) {
    translate([0,0,0]) {
        square([0.6,0.72]);
        translate([0,0.72+0.25,0]) {
         square([0.6,0.72]);
        }
        translate([0,2*(0.72+0.25),0]) {
         square([0.6,0.72]);
        }
        translate([0,3*(0.72+0.25),0]) {
         square([0.6,0.72]);
        }

        translate([0.6+0.8,0,0]) {
            square([0.6,0.72]);
            translate([0,0.72+0.25,0]) {
             square([0.6,0.72]);
            }
            translate([0,2*(0.72+0.25),0]) {
             square([0.6,0.72]);
            }
            translate([0,3*(0.72+0.25),0]) {
             square([0.6,0.72]);
            }
        }

    }
 }
}

Kunda1

2021-06-08 12:44

administrator   ~0015707

Split forum thread. Amended the ticket to reflect it

Issue History

Date Modified Username Field Change
2021-06-07 11:41 pragmatist New Issue
2021-06-07 11:42 pragmatist Note Added: 0015705
2021-06-07 11:44 pragmatist Note Added: 0015706
2021-06-07 12:07 Kunda1 Tag Attached: colors
2021-06-07 12:07 Kunda1 Tag Attached: STEP
2021-06-07 12:07 Kunda1 Tag Attached: OpenSCAD
2021-06-08 12:44 Kunda1 Description Updated
2021-06-08 12:44 Kunda1 Note Added: 0015707
2021-06-08 12:44 Kunda1 Description Updated