View Issue Details

IDProjectCategoryView StatusLast Update
0004684File formatsBugpublic2021-08-17 14:41
Reporterpragmatist Assigned Tochennes  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.20 
Fixed in 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

chennes

2021-08-09 16:07

developer   ~0015786

I'm not sure why the auto-linker didn't catch this: there is a PR in that fixes this issue --
https://tracker.freecadweb.org/view.php?id=4684

jnxd

2021-08-10 15:39

developer   ~0015796

Last edited: 2021-08-10 15:45

@chennes, you linked to the bug itself (this page). The PR is: https://github.com/FreeCAD/FreeCAD/pull/4920, if that's what you're talking about. It might have been my error not marking the issue properly. I tried to do it in the commit, but Github redirected to PR#4684.

chennes

2021-08-10 17:36

developer   ~0015797

Github always interprets those strings as Github links -- but our custom scripts are supposed to read them anyway and correctly update the ticket. Thanks for the correct link, at any rate!

jnxd

2021-08-17 04:55

developer   ~0015821

The PR has been merged. This may be closed now.

chennes

2021-08-17 14:41

developer   ~0015822

Fix merged.

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
2021-08-09 16:07 chennes Note Added: 0015786
2021-08-10 15:39 jnxd Note Added: 0015796
2021-08-10 15:45 jnxd Note Edited: 0015796
2021-08-10 17:36 chennes Note Added: 0015797
2021-08-17 04:55 jnxd Note Added: 0015821
2021-08-17 14:41 chennes Assigned To => chennes
2021-08-17 14:41 chennes Status new => closed
2021-08-17 14:41 chennes Resolution open => fixed
2021-08-17 14:41 chennes Fixed in Version => 0.20
2021-08-17 14:41 chennes Note Added: 0015822