Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,30 @@ node_modules/**
src/**
.gitignore
.yarnrc
.prettierignore
.husky/**
.mypy_cache/**
.ruff_cache/**
**/__pycache__/**
esbuild.js
vsc-extension-quickstart.md
**/tsconfig.json
**/eslint.config.mjs
**/*.map
**/*.ts
**/.vscode-test.*
CITATION.cff
ROADMAP.md
pyproject.toml
tailwind.config.js
.venv
noxfile.py
requirements.txt
python/data
python/cmake/**
python/bundled/.gitkeep
python/requirements.txt
python/datamodel/test/**
python/lsp/.venv
python/.venv
webviews/viewer/src/**
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to the **VS Code Aster** extension will be documented in thi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.2] - 2026-03-23

Various fixes and improvements.

### Added
- Export form now auto-increments unit numbers to avoid duplicates when adding new files
- Files named `export` (without extension) are now detected as export files

### Fixed
- Mesh viewer now correctly resolves .med file paths containing subdirectories (e.g. `Mesh/mesh.med`) relative to the .export file location ([#13](https://github.com/simvia-tech/vs-code-aster/issues/13))
- Selecting text no longer resets manually hidden objects in the mesh viewer ([#14](https://github.com/simvia-tech/vs-code-aster/issues/14))
- Fixed issues when two meshes share groups with the same name ([#15](https://github.com/simvia-tech/vs-code-aster/issues/15))
- Fixed error in mesh viewer ([#16](https://github.com/simvia-tech/vs-code-aster/issues/16))
- Reduced extension package size by excluding unnecessary files

## [1.5.1] - 2026-03-16

Various fixes and optimizations.
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cff-version: 1.5.1
cff-version: 1.5.2
title: VS Code Aster
message: >-
If you use this software, please cite it using the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center"><img src="https://raw.githubusercontent.com/simvia-tech/vs-code-aster/main/media/images/simvia.png" alt="Simvia Logo" width="50%" /></p>

<p align="center">
<a href="/"><img src="https://img.shields.io/badge/version-1.5.1-blue" alt="Version" /></a>
<a href="/"><img src="https://img.shields.io/badge/version-1.5.2-blue" alt="Version" /></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-GPL%203.0-green" alt="License" /></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The extension aims to reduce friction between modeling, validation, execution, and analysis by bringing **code_aster** native workflows into the editor.

## Current Capabilities (v1.5.1)
## Current Capabilities (v1.5.2)

- `.export` file generator
- 3D mesh viewer
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vs-code-aster",
"displayName": "VS Code Aster",
"version": "1.5.1",
"version": "1.5.2",
"description": "VS Code extension for code_aster",
"publisher": "simvia",
"license": "GPL-3.0",
Expand Down
6 changes: 3 additions & 3 deletions src/VisuManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function findMedFiles(commFilePath: string): string[] {
try {
const dir = path.dirname(commFilePath);
const commFileName = path.basename(commFilePath);
const exportFiles = fs.readdirSync(dir).filter((f) => f.endsWith('.export'));
const exportFiles = fs.readdirSync(dir).filter((f) => f === 'export' || f.endsWith('.export'));

if (exportFiles.length === 0) {
vscode.window.showErrorMessage(`No .export file found in directory: ${dir}`);
Expand Down Expand Up @@ -240,15 +240,15 @@ export function findMedFiles(commFilePath: string): string[] {
continue;
}

const medPath = path.isAbsolute(name) ? name : path.join(dir, name);
const medFileName = path.basename(name);
const medPath = path.join(dir, medFileName);

if (fs.existsSync(medPath)) {
console.log(`[findMedFiles] found med file: ${medFileName}`);
foundMedFiles.push(medPath);
} else {
vscode.window.showErrorMessage(
`The file "${medFileName}" mentioned in "${exportFile}" does not exist in the current directory (${path.basename(dir)}/).`
`The file "${name}" mentioned in "${exportFile}" does not exist.`
);
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/WebviewVisu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,21 @@ export class WebviewVisu implements vscode.Disposable {

// Parse the text to find object names
// Object keys are like "all_mesh.obj"; match against the stem (no "all_" prefix, no extension)
// Only send showOnlyObjects when a mesh name is explicitly selected, to avoid
// resetting user-hidden meshes on every text selection change.
const selectedObjects =
this.objects?.filter((objectKey) => {
const withoutPrefix = objectKey.startsWith('all_') ? objectKey.slice(4) : objectKey;
const shortName = withoutPrefix.replace(/\.[^.]+$/, '');
return this.makeWholeTokenRegex(shortName).test(text);
}) || [];

this.panel.webview.postMessage({
type: 'showOnlyObjects',
body: { objects: selectedObjects },
});
if (selectedObjects.length > 0) {
this.panel.webview.postMessage({
type: 'showOnlyObjects',
body: { objects: selectedObjects },
});
}
}

/**
Expand Down
25 changes: 22 additions & 3 deletions webviews/export/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ const defaultUnits = {
libr: '16',
};

function getNextAvailableUnit(defaultUnit) {
const usedUnits = new Set();
for (const f of formData.inputFiles) {
usedUnits.add(String(f.unit));
}
for (const f of formData.outputFiles) {
usedUnits.add(String(f.unit));
}
let unit = Number(defaultUnit);
if (unit === 0) {
return String(unit);
}
while (usedUnits.has(String(unit))) {
unit++;
}
return String(unit);
}

const formData = {
name: '',
parameters: {
Expand Down Expand Up @@ -179,14 +197,15 @@ function addFileRow(container, targetArray, fileObj) {
inputName.value = fileObj.name;
inputUnit.value = fileObj.unit;
} else {
fileObj = { type: 'nom', name: '', unit: '0' };
const unit = getNextAvailableUnit('0');
fileObj = { type: 'nom', name: '', unit: unit };
inputName.placeholder = 'File Name : ';
inputUnit.value = '0';
inputUnit.value = unit;
}

select.addEventListener('input', () => {
fileObj.type = select.value.trim();
const unit = defaultUnits[fileObj.type];
const unit = getNextAvailableUnit(defaultUnits[fileObj.type]);
inputUnit.value = unit;
fileObj.unit = unit;
});
Expand Down
5 changes: 5 additions & 0 deletions webviews/viewer/src/lib/commands/VisibilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export class VisibilityManager {
const wasHighlighted = this.highlightedGroupsSet.has(groupName);
const isHighlighted = typeof visible === 'boolean' ? visible : !wasHighlighted;

// Don't highlight groups on hidden objects
if (isHighlighted && this.hiddenObjects[object]) {
return;
}

if (isHighlighted) {
this.highlightedGroupsSet.add(groupName);
highlightedGroups.update((map) => {
Expand Down
4 changes: 4 additions & 0 deletions webviews/viewer/src/lib/data/create/FaceActorCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export class FaceActorCreator {
const mapper = vtk.Rendering.Core.vtkMapper.newInstance();

mapper.setInputData(polyData);
if (!groupName.includes('all_')) {
mapper.setResolveCoincidentTopology(true);
mapper.setRelativeCoincidentTopologyPolygonOffsetParameters(-2, -2);
}
actor.setMapper(mapper);

const { colorIndex, isObjectActor } = this.setProperty(actor, groupName, cellCount);
Expand Down
Loading